Navigation: Language Reference > 13 - Built-in Functions >====== WHERE (return field position in group) ====== | |
WHERE( group, field )
WHERE | Returns a field's ordinal position within a GROUP, RECORD, CLASS, or QUEUE structure. |
group | The label of a GROUP, RECORD, CLASS, or QUEUE declaration. |
field | The label of a field in the group declaration. |
The WHERE statement returns the ordinal position of a specified field in a group structure.
Return Data Type: SIGNED
Example:
MyGroup GROUP
F1 LONG !Field number 1
F2 SHORT !Field number 2
F3 STRING(30) !Field number 3
InGroup GROUP !Field number 4
F1 LONG !Field number 5
F2 SHORT !Field number 6
F3 STRING(30) !Field number 7
END
END
CurrentField LONG
CODE
CurrentField = WHERE(MyGroup,MyGroup.F1) !WHERE returns 1
CurrentField = WHERE(MyGroup,MyGroup.Ingroup.F2) !WHERE returns 6
CurrentField = WHERE(MyGroup.Ingroup,MyGroup.Ingroup.F2) !WHERE returns 2
See Also: