Tandy 1000 Basic Reference Manual page 271

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter 10 I BASIC Keywords
POS
Function
POS( number)
Returns the current column position of the cursor.
Number is a dummy argument.
POS returns a number in the range 1 to 80, indicating the cur-
rent cursor-column position on the display.
Example
P R I N T T F I B ( 4 0 )
P O S ( 0 )
prints 40. The PRINT TAB statement moves the cursor to Posi-
tion 40; therefore, POS(0) returns the value 40. (However, be-
cause a blank
is
inserted before the "4" to accommodate the
sign, the "4" is actually
at
Position 41.)
Sample Program
1 5 0 C L S
1 6 0 FIF
=
I N K E Y F
1 7 0 I F A $
=
I"'
THEN 1 6 0
1 8 0
I F P O S ( X )
>
7 0 THEN I F
A $
=
C H R F ( 3 2 )
THEN
FIB
=
C H R F ( 1 3 )
2 0 0 L P R I N T
F I B ;
2 1 0 G O T 0 1 6 0
This program lets you use your printer as a typewriter (except
that you cannot correct mistakes). Your computer keyboard is
the typewriter keyboard. Everything you type is printed on your
printer. The program also makes sure that no word is divided
between two lines.
269

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents