Open topic with navigation
When a structure contains no field definitions, you can load definitions from an existing definition file (also referred to as an include file). An include file contains field definitions, optionally preceded by the RECORD, STRUCTURE, or COMMON statement. A single file can contain multiple record definitions.
If your include file uses .DEFINEs within field definitions, for example,
custnm ,a NAMELEN
you must substitute those definitions with the actual values.
When an include file is processed, information is loaded into the field definitions in the following manner:
To load fields from a definition file,
|1.||On the Structure Definitions list, highlight the structure that you are going to load the fields into.|
|2.||Select Structure Functions > Edit Attributes.|
|3.||Select Attributes > Fields.|
|4.||From the Field Definitions list, select Field Functions > Load Fields.|
|5.||Enter data in each field as instructed below.|
Enter the name of the include file from which to load the fields. You can include a full path or logical name. On Windows, you can click the drilldown button to browse for a file to select. If you don’t specify an extension, it defaults to .def.
If the .INCLUDE file contains more than one record, specify which record to use. For example, if your .INCLUDE file contains three records and you want to use the second one, enter 2. The default record number is 1.
Strip text between
Comments in the .INCLUDE file are loaded into the field’s short and long description fields as described above. You can strip irrelevant data, such as record offsets, by specifying the two characters between which all text should be stripped. The specified characters are stripped as well. Both characters must be non-blank.
For example, a line in your .INCLUDE file might look like this:
csname ,a30 ;[10,40]Customer name
To strip the information in brackets, enter “[” and “]” in the Strip text between fields, then the short description stored for the field will be “Customer name.”
|6.||Exit the window to load the fields.|
If an error occurs while fields are being loaded, you’ll get an error message indicating which field caused the error. No additional fields are loaded. You must delete all fields that were successfully loaded before attempting to load from the .INCLUDE file again.