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

GrpFirst

Gets the value of the first element in a group. The first element in the group is the element with the lowest value. You can follow this function with a GrpNext() call, to get the value of all the elements in a group.

Syntax

GrpFirst(hGrp)

hGrp:

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

Return Value

The value of the first element in a group or -1 if the group is empty.

Related Functions

GrpOpen, GrpNext

Example

Value=GrpFirst(hGrp);
IF Value<>-1 THEN
Prompt("First value is "+Value:###);
END

See Also

Group Functions