Navigation: Language Reference > 13 - Built-in Functions >====== HOWMANY (return dimensions) ====== | |
HOWMANY( label ,element)
HOWMANY | Returns the number of dimensions for a designated element. |
label | The label of a GROUP, QUEUE or RECORD. |
element | A LONG constant or variable that identifies the ordinal position of the target element to examine. |
HOWMANY returns the number of dimensions the n'th field of a GROUP, QUEUE or RECORD. A multi-dimensioned field has its dimensions flattened.
HOWMANY will return zero (0) if you ask for the dimensions of a field within a dimensioned GROUP. To access the number of dimensions of such a field, you must first use GETGROUP to get one element of the dimensioned group.
Return Data Type: | LONG |
Example:
NestGroup GROUP
subGroup GROUP,DIM(2,2)
var1 LONG,DIM(3,3)
END
END
gr &GROUP
MyGroup GROUP
var1 LONG,DIM(3,3)
var2 LONG,DIM(100)
var3 LONG,DIM(2,3,4)
END
CODE
HOWMANY(MyGroup, 1) !Returns 9
HOWMANY(MyGroup, 2) !Returns 100
HOWMANY(MyGroup, 3) !Returns 24
HOWMANY(NestGroup, 1) !Returns 4
HOWMANY(NestGroup, 2) !Returns 0
IF ISGROUP(NestGroup, 1)
gr &= GETGROUP(NestGroup, 1, 1)
HOWMANY(gr, 1) !Returns 9
END
See Also: