Cicode Programming Reference > Cicode Function Categories > Group Functions Introduction > GrpNext

GrpNext

Gets the value of the next element in a group. You can get the value of all the elements in a group. Call the GrpFirst() function to get the value of the first element, and then call this function in a loop.

Syntax

GrpNext(hGrp, Value)

hGrp:

The group handle, returned from the GrpOpen() function. The group handle identifies the table where all data on the associated group is stored.

Value:

The value returned from GrpFirst() or the latest GrpNext() call.

Return Value

The value of the next element in a group, or -1 if the end of the group has been found.

Related Functions

GrpFirst

Example

! Count all values in a group.
Count=0;
Value=GrpFirst(hGrp);
WHILE Value<>-1 DO
Count=Count+1;
Value=GrpNext(hGrp,Value);
END
Prompt("Number of values in group is "+Count:###);

See Also

Group Functions