advr.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
  Summary  Details  Example                Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
 FIELD [#]filenumber%, fieldwidth% AS stringvariable$
                     [,fieldwidth% AS stringvariable$] ...
 
 Usage Notes
   ■ Visual Basic record variables and extended OPEN statement syntax provide
     a more convenient way to use random-access files.
     See: OPEN Statement (File I/O)  TYPE Statement
 
   ■ The total number of bytes that you allocate in a FIELD statement must
     not exceed the record length that you specified when opening the file.
     Otherwise, Visual Basic generates the error message, "FIELD overflow."
     The default record length is 128 bytes.
 
   ■ Any number of FIELD statements can 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.