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:

ParameterDescription
code

The possible codes to pass to the RTI_SETS function are:

ValueIDX EquatesDescription
1INIT_SET$Initializes a set returning a set handle.
2ADD_TO_SET$Adds data to an existing set returning an error code.
3UNION_SET$Creates a union of two sets returning a set handle.
4INTERSECT_SETS$Creates a results set of intersecting values from two sets returning a set handle.
5DIFFERENCE_SETS$Creates a results set of differing values from two sets returning a set handle.
6RESET_EXTRACT$Resets the extract parameters.
7EXTRACT_FROM_SET$Extracts the row data from a set returning an error code.

Returns 1 if more data exists in the set, 0 if all data has been extracted, or an error code (a negative integer). Parameter is: the handle. A 3rd variable is passed, it is filled with data by Set_Lib on "no error".

8SET_INFO$Reports data about a set.
9CLEAR_SET$Destroys the set and removes the handle from storage.
param1

The parameters are based on the code selected. The first parameter for each code is outlined below.

CodeParam ValueDescription
1A set of data. 
2A set of data. 
3A handle to a set.The handle of the 1st set to be used in the union.
4A handle to a set.The handle of the 1st set to be used in the intersection.
5A handle to a set.The handle of the 1st set to be used in the comparison.
6A handle to a set. 
7A handle to a set.The handle of the set to be extracted.
8A handle to a set.
9A handle to a set.The handle to be removed.
param2

The parameters are based on the code selected. The second parameter for each code is outlined below.

CodeParam ValueDescription
10 (zero)The parameter should always be zero. If a non-zero value is passed to RTI_SETS for INIT, then a handle will not be created.
2A handle to a set.The parameter should be the HANDLE of the set to which data should be added.
3A handle to a set.The handle of the 2nd set to be used in the union.
4A handle to a set.The handle of the 2nd set to be used in the intersection.
5A handle to a set.The handle of the 2nd set to be used in the comparison.
6The reset specification. 
7NA 
8<Output> Returns the count of all rows in set. 
9NA 
param3

The parameters are based on the code selected. The first parameter for each code is outlined below.

CodeParam ValueDescription
1DelimiterThe value of the delimiter used to separate the data in param1.
2NA 
3NA 
4NA 
5NA 
6A handle to a set. 
7<Output> The operation returns the data in this parameter, if the operation was successful. 
8<Output> The count of index rows in the set. 
9NA 

Returns

CodeReturn 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.
20 (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.
60 (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.
90 (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 )
  • No labels