Copy list definition

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

Syntax

Copy list definition list-or-row-name ([Clear list])

Options

Clear list If specified, the command empties the current list and removes its column definitions before executing

Deprecated Command

This command has been deprecated and is no longer visible in the Code Assistant in the Code Editor (it will not appear when you type the first few characters), although it is still present in Omnis Studio and will continue to function if used in legacy code. You can show this command by disabling the appropriate Command Filter in the Modify menu in the Code Editor.

Description

This command redefines the column headings of the current list by copying the columns and data structure from the specified list. If the current list contains data and you do not clear the list, no change is made to the internal structure of the list; in this case, columns are neither added nor removed, merely renamed and the command is similar to Redefine list.

When the current list is empty or the Clear list option chosen, the command is the equivalent to 'Define the list so that it matches the specified list'.

Example

Set current list iList1
Define list {iCol1Date,iCol2Num,iCol3Char}
Add line to list
Set current list iList2
Define list {iCol4Date,iCol5Num,iCol6Char}
Add line to list
# now change the definition of iList2 to match iList1
Copy list definition iList1 (Clear list )
# or you can do it like this
Do iList2.$copydefinition(iList1)