Tandy 1000 Basic Reference Manual page 215

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter 10
I
BASIC Keywords
LPOS
Function
LPOS(num ber)
Returns the logical position of the print head within the printer's
buffer.
Number can be 0 or
1 to indicate LPT1:.
LPOS is only useful for checking the position of the print head
after a LPRINT statement that is terminated by a semicolon to
suppress the automatic carriage return. The statement contain-
ing LPOS is not executed until the LPRINT statement is fin-
ished printing.
LPOS does not necessarily give the physical position of the print
head if the printed string contains the ASCII code for a carriage
return. For example, if you
are
printing a string of 20 characters
and the 10th character is the ASCII code for a carriage return,
the printer advances to the next line after printing the ninth
character before printing the remaining 10 characters. If the
string is terminated by a semicolon to supress the automatic line
feed, the physical location of the print head is at position 10, but
LPOS returns a value of 21 because that is the logical location
of the print head.
Example
You may want t o use LPOS t o determine whether there is
enough room to continue printing more variables on the same
line.
1 0 0 I F L P O S ( X ) > 6 0
THEN L P R I N T
If the printer has printed more than 60 characters, a carriage
return is sent so that the printer skips to the next line.
213

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents