GETGROUP (return reference to GROUP)

Top  Previous  Next

 

GETGROUP( group, number [,dimension] )

GETGROUP

Returns a reference to a specified group structure.

group

The label of a GROUP or QUEUE declaration.

number

An integer expression specifying the ordinal position of a GROUP or QUEUE in the specified group.

dimension

An optional dimension element number, if applicable.

The GETGROUP statement returns a GROUP reference to the number specified field from a target group structure. If the number specified field is a dimensioned field, then GETGROUP returns a reference to the dimension element of the number field. GETGROUP returns a NULL reference if the number specified is not a GROUP. GETGROUP will also return NULL if the number specified is a dimensioned group and no dimension is specified.This function can be used to access a field that is part of a dimensioned GROUP.

Return Data Type:

STRING

Example:

 

MyGroup  GROUP

SubGroup  GROUP,DIM(3)

number     LONG,DIM(5)

         END

        END

       

gr &GROUP

lr ANY

 

CODE

 gr &= GETGROUP(MyGroup, 1, 2)

 lr &= WHAT(gr, 1, 4)

 !lr now references MyGroup.SubGroup[2].number[4]

See Also:

HOWMANY

ISGROUP

WHAT

WHERE

WHO