$currentmember
$currentmember
Returns the position of the current member of a result set.
Syntax
$currentmember(setname)
Parameters
setname | a character string, or an expression that evaluates to a character string, being the name of a result set |
Return Value
Number, with no decimal places.
Comments
$currentmember returns the (numerical) position of the current member within the specified result set. To explicitly specify the current set, use “CurrentSet” (including the quotation marks), as CurrentSet is a reserved word and the function is expecting a character string.
To ensure against unexpected results, choose set names carefully. At run time, the software distinguishes sets only by their names, even if they are permanent set names created in different application directories.
If, for example, you produce a set called Set1 in directory PersonnelData, and later you produce another set called Set1 in directory TestData, the second version of Set1 replaces the first version. Function $currentmember works only on the most recent version of the set.
Example
let vMemberNum = $currentmember(“Set1”)
If the current member of Set1 is the fifth member, then variable vMemberNum is set to 5.
while
… process current member …
if $currentmember(“TempSet”) = $lastmember(“TempSet”)
break
endif
next TempSet
endwhile
The WHILE loop processes TempSet one member at a time, breaking out when the last member of the set has been processed.
See Also