In KUKA Robot Language (KRL), is it possible to get the length of an array, or alternatively, is there a way to loop through all the values in an array? Currently I store the array length in a separate variable and do it like this:
; In the DAT file:
DECL CONST INT FOO_LENGTH = 3
DECL CONTS INT FOO[3]
FOO[1] = 12
FOO[2] = 34
FOO[3] = 56
; In the SRC file:
INT IDX
FOR IDX = 1 TO FOO_LENGTH
do_something(FOO[IDX])
ENDFOR
Essentially I'd like to get rid of the FOO_LENGTH
variable.