Function FieldBlock() Foundation
Creates a set/get code block for a database field.
FieldBlock( <cFieldName> ) --> bFieldBlock
The return value of FieldBlock() is a code block which accesses the data of a field when executed.
The code block function FieldBlock() creates a code block that accesses a field in the current work area when it is executed. When the code is evaluated and no value is passed to block, it retrieves the current value of the field <cFieldName> and returns it. Otherwise it writes the passed value into the field and returns this new value.
The code block of FieldBlock() works only for field names. When the field name exists in multiple work areas, the code block returns the value from the field in the work area current when the block is evaluated. To create a set/get code block inherently tied to a specific work area, the function FieldWBlock() must be used.
When FieldBlock() is called, no file needs to be open in the work area. A file containing a field with the name <cFieldName> only needs to be open in the current work area when the code block is evaluated. If the field <cFieldName> does not exist when the code block is evaluated, a runtime error occurs.
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.