Xerox -07W & -11W Manuale Utente

Pagina di 370
12-33
Creating A Script File
(read) W (write) and C (create). If this string is omitted the program will
assume that the file will have read and write operations performed on it.
For example, to create the file myfile.doc and enable characters to be written to it, the
following line would be entered, specifying that the integer identifying the file is to
be stored in the variable called id:
file open id myfile.doc "cw"
The Error Numbers section lists the possible error numbers for this command.
FILE READ
Syntax: FILE READ <handle> <variable> <length>
This will read a specified number of characters from a file and assign them to a
variable, where
<handle>
is the integer variable specified by the file open command and used to
identify the file.
<variable>
is a previously defined variable (see var) which will be used to store
the characters. Note that if the variable was created in the integer for-
mat, the decimal value of the first two characters will be assigned to it.
<length>
is the number of characters to be read if the variable is in string format.
If the variable is in integer format the number of characters that will be
read is two, and if in floating point number format the number of char-
acters that will be read is four.
More than one variable (and length specifier if a string variable) may be specified to
store successive blocks of characters from the file.
The following example will read ten characters from the file identified by the handle
id and assign them to the string variable char1, then read the next six characters and
assign them to the string variable char2, and finally read the next 2 characters and
place them in the integer variable number:
file read id char1 10 char2 6 number
The Error Numbers section lists the possible error numbers for this command.
FILE RENAME
Syntax: FILE RENAME <filename> <newname>
This will rename the file specified by <filename> to that of <newname>. Both
filenames can be specified as strings or string variables.