CREATE SELECTION FROM ARRAY

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 6.7 (Modified)


CREATE SELECTION FROM ARRAY (table; recordArray{; selectionName})

ParameterTypeDescription
tableTableTable from which to create the selection
recordArrayLongint | Bool. ArrayArray of record numbers, or
Array of booleans (True = the record is in the
selection, False = the record is not in the selection)
selectionNameStringName of the named selection to create, or
Apply the command to the current selection
if the parameter is omitted

Description

The CREATE SELECTION FROM ARRAY command creates the named selection selectionName from:

either an array of absolute record numbers recordArray from table,

or an array of booleans. In this case, the values of the array indicate the belonging (True) or not (False) of each record in table to selectionName.

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: A named selection is created and loaded into memory. Therefore, make sure that you have enough memory before executing this command.

See Also

CLEAR NAMED SELECTION, COPY NAMED SELECTION, CREATE SET FROM ARRAY, LONGINT ARRAY FROM SELECTION, USE NAMED SELECTION.


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