4D v13.4LIST TO ARRAY |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v13.4
LIST TO ARRAY
|
LIST TO ARRAY ( list ; array {; itemRefs} ) | ||||||||
Parameter | Type | Description | ||||||
list | String |
![]() |
List from which to copy the first level items | |||||
array | Array |
![]() |
Array to which to copy the list items | |||||
itemRefs | Array |
![]() |
List item reference numbers | |||||
The LIST TO ARRAY command creates or overrides the array array with the first level items of the list list.
If you do not set the array as an Alpha or Text type beforehand, LIST TO ARRAY creates a new Text array by default.
The optional itemRefs parameter (a numeric array) returns the list item reference numbers.
You can use LIST TO ARRAY to build an array based on the first level items of a hierarchical list. However, this command does allow you to work with any of the list's child items. When working with hierarchical lists, we recommend that you use the hierarchical lists commands, in particular Load list.
The following example copies the items of a list called Regions into an array called atRegions:
LIST TO ARRAY("Regions";atRegions)
Product: 4D
Theme: Arrays
Number:
288
Created: < 4D v6
ARRAY TO LIST
Load list
SAVE LIST