The SLICE function returns selected members of a set.
#SLICE(set, name[, startIndex[, limit]] )
Arguments:
- set: The set.
- name: The Name of the member(s) to return. An empty set matches any name.
- startIndex: The index (one-based) of the first member matching the name to return. If negative, the index is from the end of the set.
- limit: The maximum number of members to return.
Returns:
- The selected members of the set
Example:
WHERE ebay.active LIMIT 1
SET $mySet TO #SET()
ADD 'Name1', 'Value 1' TO $mySet
ADD 'Name2', 'Value 2' TO $mySet
ADD 'Name2', 'Value 3' TO $mySet
ADD 'Name2', 'Value 4' TO $mySet
ADD 'Name3', 'Value 5' TO $mySet
ADD 'Name4', 'Value 6' TO $mySet
EVAL #SLICE($mySet, '', 1, 2)
EVAL #SLICE($mySet, '', -1, 2)
EVAL #SLICE($mySet, 'Name2', 2, 1)
EVAL #SLICE($mySet, '', 5, 5)
EVAL #SLICE($mySet, '', 15, 15)
#SLICE($mySet, '', 1, 2)
- Name1 => Value 1
- Name2 => Value 2
#SLICE($mySet, '', -1, 2)
- Name3 => Value 5
- Name4 => Value 6
#SLICE($mySet, 'Name2', 2, 1)
- Name2 => Value 3
#SLICE($mySet, '', 5, 5)
- Name3 => Value 5
- Name4 => Value 6
#SLICE($mySet, '', 15, 15)
- (empty set)