Swap lists

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

Syntax

Swap lists list-or-row-name

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 swaps the definition and contents of the specified list with that of the current list and sets the flag. After this command, the current list contains the fields and data which were held in the specified list, and the specified list contains the fields and data which were in the current list.

This command cannot be used to copy lists. To do this use Calculate LIST2 as LIST1.

Example

Set current list iList1
Define list {fCustomers}
Build list from file
Swap lists iList2
# Note: iList2 now contains the defintion and data from iList1 (the current list)
# iList1 is now empty