Tandy 1000 Basic Reference Manual page 261

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter 10 I BASIC Keywords
PEN
Function
PEN( num ber)
Returns the light pen's coordinates.
Number is a number in the range 0 to 9 that tells BASIC what
to return. Values 0-5 return
x,y coordinates corresponding
to
the
current screen mode. Values 6-9 return the character row or col-
umn position.
0
1
2
3
4
5
6
7
8
9
Returns a -1 if pen button has been pressed since last
poll. Returns a 0 if not.
Returns the x coordinate (horizontal) where the pen
was last activated.
Returns the y coordinate (vertical) where the pen was
last activated.
Returns a -1 if the pen button is being pressed. Re-
turns a 0 if it is up.
R e t u r n s t h e l a s t known valid x c o o r d i n a t e
(horizontal).
Returns the last known valid y coordinate (vertical).
Returns the character row position where the pen was
last activated.
Returns the character column position where the pen
was last activated.
Returns the last known character row position.
Returns the last known character column position.
You must execute
a PEN ON
statement before executing the
PEN
function. If you do not, an "Illegal function call" error
occurs.
Example
A
=
P E N C 1 )
returns the x coordinate of the pen.
259

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents