Description
IDX_SETS is a function that performs union, intersection and difference of delimited sets of row data. The function has 9 calling modes that allow it to create, add data to, intersect, union, difference, extract data from, and clear sets. The parameters for each calling mode are specific to the calling mode.
Syntax
result = RTI_Sets ( code, param1, param2, param3 )
Parameters
The function has the following parameters:
Parameter | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
code | The possible codes to pass to the RTI_SETS function are:
| ||||||||||||||||||||||||||||||
param1 | The parameters are based on the code selected. The first parameter for each code is outlined below.
| ||||||||||||||||||||||||||||||
param2 | The parameters are based on the code selected. The second parameter for each code is outlined below.
| ||||||||||||||||||||||||||||||
param3 | The parameters are based on the code selected. The first parameter for each code is outlined below.
|
Returns
Code | Return Value |
---|---|
1 | <Integer> A positive integer is returned if the operation was successful and a new set was created. The positive integer is the new set's Handle. A negative integer is an error code. |
2 | 0 (zero) if successful < 0 (less than zero) if unsucessful |
3 | <Integer> A positive integer is returned if the operation was successful and a new set was created. The positive integer is the new set's Handle. A negative integer is an error code. |
4 | <Integer> A positive integer is returned if the operation was successful and a new set was created. The positive integer is the new set's Handle. A negative integer is an error code. |
5 | <Integer> A positive integer is returned if the operation was successful and a new set was created. The positive integer is the new set's Handle. A negative integer is an error code. |
6 | 0 (zero) if successful < 0 (less than zero) if unsucessful |
7 | <Integer> 0 (zero) is returned if all data has been extracted from the set. 1 is returned if there is more data to be extracted from the set. A negative integer is an error code. |
8 | <Output> The count of index rows in the set. |
9 | 0 (zero). Always. |
Remark
Handles are a returned as sequential numeric counter.
Note: The idxSets_Setup.msi must be installed on the workstations running OpenInsight in order for the RTI_Sets function to work properly. The idxSets_Setup.msi can be installed from the ClientSetup.exe in the root OpenInsight directory or from the .msi file itself, also in the root OpenInsight directory.
Examples
The Examples below use the following equate values: Equ INIT_SET$ To 1 ;* Initializes a set returning a Equ ADD_TO_SET$ To 2 ;* Adds data to an existing set. Returns Equ UNION_SETS$ To 3 ;* Performs the union of two sets Equ INTERSECT_SETS$ To 4 ;* Performs the intersection of two Equ DIFFERENCE_SETS$ To 5 ;* Performs the difference of two Equ RESET_EXTRACT$ To 6 ;* Sets the extract parameters (restart Equ EXTRACT_FROM_SET$ To 7 ;* Extracts row data from a set. Returns Equ SET_INFO$ To 8 ;* Reports data about a set. Equ CLEAR_SET$ To 9 ;* Clears a set_handle from the library's
Initialize A Set
* Initialize a set set_A = "1" : @vm : "2" : @vm : "3" handle_A = RTI_SETS( INIT_SET$, set_A, 0, @vm )
Add to a Set
* Initialize a set set_A = "1" : @vm : "2" : @vm : "3" handle_A = RTI_SETS( INIT_SET$, set_A, 0, @vm ) * Add to a set set_B = "2" : @vm : "3" : @vm : "4" hResult = RTI_SETS( ADD_TO_SET$, set_B, handle_A )