Clear list

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

Syntax

Clear list ([Hash lists])

Options

Hash lists If specified, the command clears #L1-#L8 rather than the current list. When this option is specified, the command is not reversible

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 clears all the lines in the current list and frees the memory they occupy. It does not alter the definition of the list. If you use Clear list as part of a reversible block, the list lines will be reloaded when the method containing the reversible block finishes. The list is only reloaded if it occupies 50,000 bytes of storage or less. Executing Clear list for a smart list sets $smartlist to kFalse, meaning that it is no longer a smart list.

The All Lists option only clears the hash variable lists #L1 to #L8: all other lists including task, class, instance and local variable lists, are not cleared by this command.

The following method builds a list of data formats depending on the type of graph selected by the user. Before the method is built the list is cleared using the Clear list command; this ensures the list is initialized and completely empty of data.

Example

Set current list iMyList
Clear list
# or you can do it like this
Do iMyList.$clear()