Function FieldWBlock() Foundation
Creates a set/get code block for a field in a specific work area.
FieldWBlock( <cFieldName>, <nWorkArea>|<cAlias> ) --> bFieldBlock|NIL
The return value of FieldWBlock() is a code block providing access to the data of a field in a specific work area when it is evaluated. If the parameter are not of the expected types then NIL is returned.
The code block function FieldWBlock() creates a code block providing (when it is evaluated) read and write access to a field in the specified work area. If no value is passed to the code block when it is evaluated, the current value from the field <cFieldName> is read and returned. Otherwise, the code block writes the passed value into the field and returns this new value.
When FieldWBlock() is called, no file needs to be opened in the specified work area. However, when the code block is evaluated, the file containing the field the code block is accessing must be open. If the field <cFieldName> does not exist when the code block is evaluated, a runtime error occurs.
FieldWBlock() differs from the function FieldBlock() in that the returned code block is tied to a specific work area. If the work area is specified by a numeric value <nWorkArea>, the code block is tied to this specific work area.
If an alias name <cAlias> is passed to the function, the code block is tied to the workarea with the name <cAlias>. The resulting codeblock can access the field if the database file is closed and then reopened in another work area with the same name.
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.