Statement FIELD Foundation
Declares variables of the storage class FIELD.
FIELD <FieldName,...> [IN <AliasName>]
The FIELD statement declares variables whose contents are stored in a database file. By using the optional alias name, the compiler can resolve assignments for fields that are referenced without an alias name and alias operator in the source code. The alias name <AliasName> is used to resolve references to fields that are not explicitly aliased. The FIELD statement only affects the listed fields, and has no affect on macro expressions at runtime.
The maximum length of the variable name in <FieldName,...> is dependent on the actual database engine (DBE). With the DBFDBE, the maximum length for field names is 10 characters.
The FIELD statement must precede executable statements in the procedures or functions in which it is used. Its scope is the function or procedure in which it occurs. When the FIELD statement is placed at the beginning of the source code file, giving it filewide scope, it must precede all executable statements. The FIELD statement does not open any file, nor does it test for the existence of the fields. Referencing a field variable when the file is not in use at runtime causes a runtime error.
The FIELD statement allows for the correct referencing of variables without alias identifiers at compile time, which are declared neither as LOCAL, STATIC nor MEMVAR. The /W compiler switch causes warning messages for ambiguous (undeclared) variables.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.