AT&T 6300 Programmer's Manual page 113

Gwbasic by microsoft
Hide thumbs Also See for 6300:
Table of Contents

Advertisement

Disk File Handling
CREATING A RANDOM ACCESS FILE
Creation of a random access file requires the
following program steps.
1 OPEN the file for random access ("R" mode).
Always use the "R" (Random) mode for random
access files. "R" allows you to perform both
input and output operations on a file.
This example specifies a record length of 32
bytes. If the record length is omitted, the
default is 128 bytes.
OPEN "R",#1,"FILE",32
2 Use the FIELD statement to allocate space in
the random buffer for the variables that will be
written to the random file.
FIELD #1,20 AS NS, 4 AS AS,S AS PS
3 Use the LSET command to move the data into
the random buffer. Numeric values must be
made into strings when placed in the buffer. To
do this, use the "make" functions. MKI$ makes
an integer value into a string, MKS$ does the
same for a single precision value, and MKD$
converts a double precision value. See the
Reference section for more information on these
functions.
4-29

Advertisement

Table of Contents
loading

Table of Contents