Define list

Command group Flag affected Reversible Execute on client Platform(s)
Lists NO YES NO All


Define list {list-of-field-or-file-names (F1,F2..F3,F4)}


This command defines the variables or file class field names to be used as the column definitions for the current list; it should follow Set current list. The variables or fields used in the definition also describe the data type and length for each column of data held. This command clears the definition and data in the current list. When reversed, the contents and definition of the current list are restored to their former values. Duplicate names are ignored in your list of variables or fields.


Set current list iList1
; define columns iCol1Date, iCol2Num & iCol3Char for the current list
Define list {iCol1Date,iCol2Num,iCol3Char}
; same as before but ignores the duplicate reference to iCol3Char
Define list {iCol1Date,iCol2Num,iCol3Char,iCol3Char}
; define the list based upon all the columns in the file class fCustomers
Define list {fCustomers}
; Alternatively, you can avoid using Set Current List by using the following notation
Do iList1.$define(iCol1Date,iCol2Num,iCol3Char)
; define the list based upon a table,schema or query class
Do iList1.$definefromsqlclass('myTableOrSchemaOrQueryClass')
; Normally, the length of a column is set by the type or length of the variable or field defined for
; the column, therefore the column length for a default character variable would be 10 million.
; However, when you define the list you can truncate the data stored in the column using
; VariableName/N. For example to use only the first 10 characters of the variable iCol3Char in column 3
Define list {iCol1Date,iCol2Num,iCol3Char/10}