English
Language : 

NSB8 Datasheet, PDF (62/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
grifo®
READ#
ITALIAN TECHNOLOGY
STATEMENT:
READ #<file number expression>, <variable list>
READ #<file number expression> %<random address>, <variable list>
ACTION:
For each variable in the list, the next sequential data value from the specified diskette file is obtained,
and assigned to the variable. Reading of values may commence at a specified point in the file (x-many
BYTE positions from the start) if the random address is used. The address specification consists of
a percent sign (%) followed by a numeric expression which evaluates to an integer between 0 and
the last legal byte address within the file. The file number is a numeric expression of integer value
from 0 to 7. Any numeric variable in the list may be prefixed with an ampersand (&) which instructs
BASIC to READ the next byte of data and assign its decimal value (interpreted as an integer from
0 to 255) to the variable.
EXAMPLES:
READ #2, A,B,C
READ #3,Q,&B7,A$
READ #F%L,&X,&Y,&Z
READ #0%FNL(I)+3,R8,Z$,R9
REMARKS:
BASIC maintains a pointer into each open file. When the file is opened, the pointer is set to the
beginning of the file, this pointing to the first byte of the first value in the file. Each time a value is
assigned to a variable, the file pointer moves past that value, and points to the first byte of the next
value in the file.
Use of the optional random address expression resets the file pointer to the specified byte address in
the file, before reading begins.
ERROR MESSAGES:
TYPE ERROR
The types of the variable and the value to be assigned to it do not match. For example, this will occur
if an attempt is made to READ a string value into a numeric variable. A TYPE ERROR also occurs
when an attempt is made to READ more data than is included in the file (reading the endmark). This
error will also occur if use of random accessing results in the file pointer being set to, for example,
the middle of a string or numeric value in the file.
OUT OF BOUNDS ERROR
Either or both of the following conditions has occurred:
1) The random access address is less than 0 or greater than (the file size in blocks)*256-1.
2) The file number is less than 0 or greater than 7.
SEE ALSO:
Section DATA FILES
Statement WRITE#
Page 50
NSB8
Rel. 5.10