file number is the file number used when the file was opened.
When transmitting or receiving a file through a communication port, LOC returns the number of characters in the input buffer waiting to be read. The default size for the input buffer is 256 characters, but can be changed with the /c: option on the GW-BASIC command line. If there are more than 255 characters in the buffer, LOC returns 255. Since a string is limited to 255 characters, this practical limit alleviates the need to test for string size before reading data into it. If fewer than 255 characters remain in the buffer, then LOC returns the actual count.
With random disk files, LOC returns the record number just read from, or written to, with a GET or PUT statement.
With sequential files, LOC returns the number of 128-byte blocks read from, or written to, the file since it was opened. When the sequential file is opened for input, GW-BASIC initially reads the first sector of the file. In this case, the LOC function returns the character 1 before any input is allowed.
If the file was opened but no disk input/output was performed, LOC returns a zero.
200 IF LOC(1)>50 THEN STOP
The program stops after 51 records are read or written.
All Frank Sinatra recordings, All Beatles albums, All solo albums from John Lennon, Paul McCartney, George Harrison and Ringo Starr, All Beatles songs, List of Platinum selling albums, Database with hits from 1950 to 1999.
Sought after DLL files, Nutworks magazine (retro), Worldwide ISO and TLD codes, File extensions database, The Hackers dictionary, Free software for the Atari, Amiga and Macintosh, Nokia smartphone, PocketPC, List of all BASIC programming language commands, List of all DOS commands, Free Advanced Bash-Scripting Guide (Linux-Unix)