|Token code:||BASIC 4.0:|
in BASIC ROM:
|List of all BASIC keywords|
Remark: This article describes the BASIC-Command RECORD in BASIC 4.0 / V7.0 and later.
Type: Command General Programming-Syntax: RECORD#<file number>,<record number>[<,><bytes>]
The BASIC command RECORD# is used to move a file pointer within a previously opened file in order to position it for the following GET#, PRINT# or INPUT#. It is used to read and write structured data in files, typically on floppy disks, avoiding the need to read byte-by-byte.
The default value for bytes is 1. When RECORD# is used for output using PRINT#, the system automatically adds enough 1-byte records to hold the data. For instance, if you run:
200 RECORD#1,1 210 PRINT#1,"HELLO"
five 1-byte records will be written to the file to hold HELLO. When used with GET# the bytes are always 1 and this parameter is ignored. bytes is primarily needed for INPUT#, to read the previously written string, one would use:
300 RECORD#1,1,5 310 INPUT#1,A$
Note that if the value for bytes is calculated, it needs to be placed in parens: