4D v14.3

CREATE SET FROM ARRAY

Home

 
4D v14.3
CREATE SET FROM ARRAY

CREATE SET FROM ARRAY 


 

CREATE SET FROM ARRAY ( aTable ; recordsArray {; setName} ) 
Parameter Type   Description
aTable  Table in Table of the set
recordsArray  Longint, Boolean array in Array of record numbers, or Array of booleans (True = the record is in the set, False = the record is not in the set)
setName  String in Name of the set to create, or Apply the command to the Userset if omitted

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.

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

 
PROPERTIES 

Product: 4D
Theme: Sets
Number: 641

This command modifies the Error system variable

 
HISTORY 

Modified: 4D v6.7

 
SEE ALSO 

BOOLEAN ARRAY FROM SET
CREATE SELECTION FROM ARRAY
Identifiers

 
ARTICLE USAGE

4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)