This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20.6
CREATE SELECTION FROM ARRAY
|
CREATE SELECTION FROM ARRAY ( aTable ; recordArray {; selectionName} ) | ||||||||
Parameter | Type | Description | ||||||
aTable | Table |
![]() |
Table from which to create the selection | |||||
recordArray | Longint, Boolean array |
![]() |
Array of record numbers, or Array of booleans (True = the record is in the selection, False = the record is not in the selection) | |||||
selectionName | String |
![]() |
Name of the named selection to create, or Apply the command to the current selection if the parameter is omitted | |||||
The CREATE SELECTION FROM ARRAY command creates the named selection selectionName from:
Warning: A named selection is created and loaded into memory. Therefore, make sure that you have enough memory before executing this command.
If you don’t pass selectionName or if you pass an empty string, the command will be applied to the current selection, which will then be updated.
When you use a Longint array with this command, all the numbers of the array represent the list of record numbers in selectionName. If a number is incorrect (record not created), error -10503 is generated.
Note: Be careful, you must make sure that the array does not contain any lines that have the same value, otherwise the resulting selection will be incorrect.
When you use a Boolean array with this command, the Xth element of the array indicates if the record number X is (True) or is not (False) in selectionName. The number of elements in recordArray must be equal to the number of records in table. If the array is smaller than the number of records, only the records defined by the array can make up the selection.
Note: With an array of booleans, the command uses elements from numbers 0 to X-1.
Warning: Keep in mind that a record number can be reused if the record is deleted and another record is created (see About Record Numbers).
If a record number is invalid (record not created), the error -10503 is generated. You can intercept this error using a method installed by the ON ERR CALL command.
CLEAR NAMED SELECTION
COPY NAMED SELECTION
CREATE SET FROM ARRAY
LONGINT ARRAY FROM SELECTION
SELECTION TO ARRAY
USE NAMED SELECTION
Product: 4D
Theme: Selection
Number:
640
Modified: 4D v6.7
4D Language Reference ( 4D v20)
4D Language Reference ( 4D v20.1)
4D Language Reference ( 4D v20.2)
4D Language Reference ( 4D v20.3)
4D Language Reference ( 4D v20.4)
4D Language Reference ( 4D v20.5)
4D Language Reference ( 4D v20.6)