LIST TO ARRAY

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 3

Compatibility Note

Due to the new implementation of Choice Lists, compatibility for this command could not be fully maintained. Also, starting with version 6, we recommend that you start using the command Load list to work with the hierarchical lists defined in the Design environment List Editor.


LIST TO ARRAY (list; array{; itemRefs})

ParameterTypeDescription
listStringList from which to copy the first level items
arrayArrayArray to which to copy the list items
itemRefsArrayList item reference numbers

Description

The LIST TO ARRAY command creates or overrides the array array with the first level items of the list list.

LIST TO ARRAY creates or overrides an array with a new text array.

The optional itemRefs parameter (a numeric array) returns the list item reference numbers.

Compatibility Note: In the previous version of 4D, this array was filled with the names of any linked lists. If an element of the list had a linked list, the name of the linked list was put into the array element with the same number as the list element. If there was no linked list, then the element was the empty string. The second array was set to the same size as array. You could use the names in this array to access the linked lists.

You can continue to use LIST TO ARRAY to build an array based on the first level items of a hierarchical list. However, this command does not provide you with the child items, if any. To work with hierarchical lists, use the new Hierarchical Lists commands introduced in version 6.

Example

The following example copies the items of a list called Regions into an array called atRegions:

   LIST TO ARRAY ("Regions"; atRegions )

See Also

ARRAY TO LIST, Load list, SAVE LIST.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next