PI1X Basic Programming Manual Ver. 1.10
80/156
Purpose
:
To check if file pointer of a file reaches end of file.
Syntax
:
E%=EOF # FILEID%
Example
:
WHILE (EOF#FILEID% <> -1)
Str$=GET$ # FILEID%
PRINT Str$
WEND
Description
:
E%
is an integer to be assigned to the result.
E%
Meaning
0 (False)
Not end-of-file.
-1 (True)
End-of-file
FILEID%
is an integer variable indicating the file handle.
You can use the GET_FILE_ERROR command to get the
file error code. Possible error codes and their interpretation
are listed below:
GET_FILE_ERROR Meaning
2
File specified does not exist.
8
File not opened
Purpose
:
To get or move the file pointer position of a file.
Syntax
:
TELLPTR% = PTR # FILEID%
PTR # FILEID% = NPTR%
Example
:
...
TELLPTR%=PTR # FILEID%
…
PTR # FILEID% = 40
Description
:
TELLPTR %
is an integer variable to be assigned to the
result.
TELLPTR% = PTR # FILEID%, to get the file pointer
position of a file.
NPTR %
is an integer variable indicating the offset bytes
address been specified.
FILEID%
is an integer variable indicating the file handle.
You can use the GET_FILE_ERROR command to get the
file error code. Possible error codes and their interpretation
are listed below:
GET_FILE_ERROR Meaning