PI1X Basic Programming Manual Ver. 1.10
81/156
2
File specified does not exist.
9
Illegal offset value.
15
New position is beyond
end-of-file.
Purpose
:
To get or change file length of a file.
Syntax
:
FILESIZE% = EXT # FILEID%
EXT # FILEID% = SIZE%
Example
:
FILESIZE%=EXT # FILEID%
PRINT FILESIZE%
…
EXT # FILEID% = 20
Description
:
FILESIZE%
is an integer variable to be returned the file
length.
SIZE%
is an integer variable indicating the length to be
changed of the 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 the file error code.
Syntax
:
A%=GET_FILE_ERROR
Example
:
A%=GET_FILE_ERROR
PRINT “File error code:”,A%
Description
:
A%
is an integer to be assigned to the result. If there is no
error, it returns 0. If it returns a value other than 0, it’s file
error code.