Commodore 128 Programmer's Reference Manual page 69

Hide thumbs Also See for 128:
Table of Contents

Advertisement

BASIC BUILDING BLOCKS AND BASIC 7.0 ENCYCLOPEDIA
59
EXAMPLES:
10 PUDEF"*"
PRINT * in the place of blanks.
I
20 PUDEF"<"
PRINT < in the place of commas.
READ
f
j
/ \
Read data from DATA statements and input it into a numeric or string variable)
READ variable list
j |
This statement inputs information from DATA statements and stores it in variables,
f ■
where the data can be used by the RUNning program.
In a program, you can READ the data and then re-read it by issuing the
H
RESTORE statement. The RESTORE sets the sequential data pointer back to the
/
beginning, where the data can be read again. See the RESTORE and DATA statements.
EXAMPLES:
10 READ A, B, C
READ the first three numeric variables from
20 DATA 3, 4, 5
the closest data statement.
10 READ A$, B$, C$
READ the first three string variables from
20 DATA JOHN, PAUL, GEORGE
the nearest data statement.
10 READ A, B$, C
READ (and input into the C128 memory) a
20 DATA 1200, NANCY, 345
numeric variable, a string variable and an
other numeric variable.
RECORD
Position relative file pointers
RECORD# logical file number, record number [,byte number]
This statement positions a relative file pointer to select any byte (character) of any
record in the relative file.
When the record number value is set higher than the last record number in the file,
the following occurs:
For a write (PRINT#) operation, additional records are created to expand the file
to the desired record number.
For a read (INPUT#) operation, a null record is returned and a *'RECORD NOT
PRESENT ERROR occurs". See your disk drive manual for details about relative
files.
EXAMPLES:
10 DOPEN#2,"FILE"
20RECORD#2,10,1
30 PRINT#2,A$
40 DCLOSE#2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents