Skip to main content
Version: 20 R7 BETA

CREATE SET FROM ARRAY

CREATE SET FROM ARRAY ( aTable ; recordsArray {; setName} )

ParameterTypeDescription
aTableTableTable of the set
recordsArrayInteger, Boolean arrayArray of record numbers, or Array of booleans (True = the record is in the set, False = the record is not in the set)
setNameTextName of the set to create, or Apply the command to the Userset if omitted

Description

The CREATE SET FROM ARRAY command creates setName from:

  • Either an array of absolute record numbers recordsArray from aTable,
  • Or an array of booleans recordsArray. In this case, the values of the array indicate if each record in the table belongs (True) or not (False) to setName.

When you use this command and pass a Longint array in recordsArray, all the numbers in the array represent the list of record numbers that are in setName. If a number is invalid (for example, if a record has not been created), the error -10503 is generated.

When you use this command and pass a Boolean array in recordsArray, the Nth element of the array indicates whether the "Nth" record is contained (True) or not (False) in setName. Usually, the number of elements in the array must equal the number of records in the table. If the array is smaller than the number of records, only the records defined by the array will be in the set.

Note: With a Boolean array, this command uses the elements from 0 to N-1.

If you do not pass the setName parameter or if you pass an empty string, the command will be applied to the Userset system set.

Error management

In a Longint array, if a record number is invalid (record not created), the error -10503 is generated.

See also

BOOLEAN ARRAY FROM SET
CREATE SELECTION FROM ARRAY

Properties

Command number641
Thread safe
Modifies variableserror