Note | This command is defined in a header file and will be preprocessed by the X# preprocessor to a function call. If you disable the standard header (-nostddefs) files then this command will not be available. If you tell the compiler to use a different standard header file (-stddef ) then this command may also be not available |
Replaces the data in the current record of the currently selected table with data from an array, a set of variables, or an object.
GATHER FROM ArrayName | MEMVAR | NAME ObjectName
[FIELDS FieldList | FIELDS LIKE Skeleton | FIELDS EXCEPT Skeleton]
[MEMO]
FIELDS <idFieldList> | The list of fields to process. The default is all fields with the exception of memo fields, unless the command supports the MEMO clause. |
Only fields with the same names and types in both files are appended. If fields with the same name do not match in data type, a runtime error is raised. |
FIELDS LIKE <Skeleton> | You can specify field names with a wild card, such as FIELDS LIKE *name |
FIELDS EXCEPT <Skeleton> | You can exclude fields, such as for example the primary keys: FIELDS EXCEPT Id <Skeleton> supports wildcards (* and ?). For example, to replace all fields that begin with the letters A and P, use: FIELDS LIKE A*,P* |
Please note that you can combine FIELDS LIKE and FIELDS EXCEPT but you cannot combine a fields list with the LIKE and EXCEPT clauses.
FROM <ArrayName> | Specifies the array whose data replaces the data in the current record. The contents of the elements of the array, starting with the first element, replace the contents of the corresponding fields of the record. The contents of the first array element replace the first field of the record; the contents of the second array element replace the second field, and so on. If the array has fewer elements than the table has fields, the additional fields are ignored. If the array has more elements than the table has fields, the additional array elements are ignored. |
MEMVAR | Specifies the variables or array from which data is copied to the current record. Data is transferred from the variable to the field that has the same name as the variable. The contents of a field are not replaced if a variable doesn't exist with the same name as the field. |
NAME <ObjectName> | Specifies an object whose properties have the same names as fields in the table. The contents of each field are replaced by the value of the property with the same names as the fields. The contents of a field are not replaced if a property doesn't exist with the same name as the field. |
MEMO | Specifies that the contents of memo or Blob fields are replaced with the contents or array elements or variables. If you omit MEMO, memo and Blob fields are skipped when GATHER replaces the contents of fields with the contents of an array or variable. General and picture fields are always ignored in GATHER, even if you include the MEMO keyword. |