Tandy 1000 Basic Reference Manual page 210

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter
10
I BASIC Keywords
LO C/C ommunic at ions
Function
LOC
(buffer)
Returns the number of characters in the input queue if that
number is 255 or less.
If the queue contains 256 or more characters, the LOG function
returns the number 255. Since a string is limited to 255 charac-
ters, this limit eliminates the need for testing string size before
reading data into the queue.
Buffer is the number assigned to the file when you opened it.
The default size for the input queue is 256 characters, but you
can change the size by using the / C : option when loading BASIC.
Ex
ample
1 0 X = L O C < I )
2 0
I f
X > 0
THEN
A $ = I N P U T $ ( L O C ( l ) , # I )
Line 18 checks to see if there are any characters in the input
queue and stores the number of characters in the variable
X.
Line 20 tests the value of
X.
If X is greater than 0, there are
characters in the input queue, and Line 28 returns the charac-
ters in the buffer into A$.
Notice from the example that INPUT$ is preferred over LINE
INPUT# or INPUT# when reading communications files. This
preference is because all ASCII characters might be significant
in communications. INPUT$ allows all characters to be read.
The other statements do not. LINE INPUT# stops at a carriage
return. INPUT# stops at a comma or a carriage return.
208

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents