| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== GETGROUP (return reference to GROUP) ====== | [[getfont get font information .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[getini return ini file entry .htm|{{btn_next_n.gif|Next page}}]] | | || **GETGROUP(**// group, number //[//,dimension//]// //**)** {{blk2blue.jpg|blk2blue.jpg}} | **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 return dimensions .htm|HOWMANY]] [[isgroup return group type or not .htm|ISGROUP]] [[what return field from group .htm|WHAT]] [[where return field position in group .htm|WHERE]] [[who return field name from group .htm|WHO]]