SET OF

SET [ OF type ]

typeThe value type of the data in the set. Valid value types are: INTEGER, REAL, BOOLEAN, STRING, UNICODE, DATA, or DATASET(recstruct). If omitted, the type is INTEGER.

The SET OF value type defines Attributes that are a set of data elements. All elements of the set must be of the same value type. The default value for SET OF when used to define a passed parameter may be a defined set, the keyword ALL to indicate all possible values for that type of set, or empty square brackets ([ ]) to indicate no possible value for that type of set.

Example:

SET OF INTEGER1 SetIntOnes := [1,2,3,4,5];
SET OF STRING1 SetStrOnes := ['1','2','3','4','5'];
SET OF STRING1 SetStrOne1 := (SET OF STRING1)SetIntOnes;
        //type casting sets is allowed
r := {STRING F1, STRING2 F2};
SET OF DATASET(r) SetDS := [ds1, ds2, ds3];
        
StringSetFunc(SET OF STRING passedset) := AstringValue IN passedset;
        //a set of string constants will be passed to this function
HasNarCode(SET s) := Trades.trd_narr1 IN s OR Trades.trd_narr2 IN s;
        // HasNarCode takes a parameter that specifies the set of valid
        // Narrative Code values (all INTEGERs)
SET OF INTEGER1 SetClsdNar := [65,66,90,114,115,123];
NarCodeTrades := Trades(HasNarCode(SetClsdNar));
        // Using HasNarCode(SetClsdNar) is equivalent to:
        // Trades.trd_narr1 IN [65,66,90,114,115,123] OR
        // Trades.trd_narr2 IN [65,66,90,114,115,123]

See Also: Functions (Parameter Passing), Set Ordering and Indexing