ARRAY TO LIST

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, 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 use the command SAVE LIST to work with the hierarchical lists defined in the Design environment List Editor.


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

ParameterTypeDescription
arrayArrayArray from which to copy array elements
listStringList into which to copy array elements
itemRefsArrayNumeric array of item reference numbers

Description

The ARRAY TO LIST command creates or replaces the list list (as defined in the Design environment List Editor) using the elements of the array array.

This command allows you to define only the first level items of the list.

The optional itemRefs parameter, if specified, must be a numeric array synchronized with the array array. Each element, then, indicates the list item reference number for the corresponding element in array. If you omit this parameter, 4D automatically sets the list item reference numbers to 1, 2... N.

Compatibility Note: In the previous version of 4D, this parameter was used to link other lists to each element in array. If an element of the links array was the name of an existing list, then that list was attached to the corresponding item.

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

Example

The following example copies the array atRegions to the list called "Regions:"

   ARRAY TO LIST (atRegions;"Regions")

See Also

LIST TO ARRAY, Load list, ON ERR CALL, SAVE LIST.

Error Handling

An error -9957 is generated when ARRAY TO LIST is applied to a list that is currently being edited in the Design environment List Editor. You can catch this error using an ON ERR CALL project method.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next