Hi,
I am having trouble determining the length of an array during program execution.
So the array variable, called TIMEPATH, is defined in R1/System/config.dat as:
And I have an external program that initializes a random amount of E6POS inside of that array, so for instance it could initialize the first 5 items in the array and leave the last five uninitialized. So far this works fine.
My issue is when I go to determine the length of that array during my routine:
Code
DECL INT Counter
DECL INT ArrayLength
DECL INT Number
...
FOR Number = 1 to 10
IF(VARSTATE("TIMEPATH[Number]")<>#INITIALIZED) THEN
msgnotify("Not Initialized")
ArrayLength = (Number -1)
Number = 10
ENDIF
msgnotify("Initialized")
ENDFOR
FOR Counter = 1 TO ArrayLength
PTP TIMEPATH[Counter]
ENDFOR
Display More
ArrayLength is always returning as 1 or 0 aka my VARSTATE function is not working properly.
Has anyone dealt with this problem before?
I have found another suggestion on the forums but it also does not seem to have been resolved.
Thanks!
Edit: Using KRC4 and KSS 8.3.8