qb45advr.hlp (
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
FIELD Statement Details
◄QuickSCREEN► ◄Details► ◄Example► ◄Contents► ◄Index►
──────────────────────────────────────────────────────────────────────────────
FIELD Statement Details
Syntax
FIELD [#]filenumber, fieldwidth AS stringvariable
[,fieldwidth AS stringvariable] ...
Argument Description
filenumber The number used in the file's OPEN statement
fieldwidth The width of the field in the record
stringvariable The string variable that contains the date read
from a record or data that is used in an
assignment when information is written to a record
The total number of bytes that you allocate in a FIELD statement
must not exceed the record length that you had specified when opening
the file. Otherwise, an error message is generated that reads "FIELD
overflow." (The default record length is 128 bytes.)
Any number of FIELD statements may be executed for the same file. All
FIELD statements that have been executed remain in effect at the same
time.
All field definitions for a file are removed when the file is closed;
that is, all strings defined as fields associated with the file are
set to null.
Do not use a variable name defined as a field in an INPUT or
assignment statement if you wish the variable to remain a field. Once
a variable name is a field, it points to the correct place in the
random-access file buffer. If a subsequent INPUT or assignment
statement with that variable name is executed, the variable's pointer
no longer refers to the random-access record buffer, but to string
space.
Note: BASIC's record variables and extended OPEN statement syntax
provide a more convenient way to use random-access files.
Differences from BASICA
When a random-access file is closed with a CLOSE or RESET statement in
a compiled program, all variables that are fields associated with that
file are reset to null strings. When a random-access file is closed in
a BASICA program, variables that are fields retain the last value
assigned to them by a GET statement.