As I understand it Aspect does not allow for truely dynamic arrays. So you really just have to:
1. Dimension your array plenty large when you first define it.
* Note that if you like to keep your variables locals like Computer Sci types push you'll run into a problem of limited memory space reserved by Procomm.
* The cure for that is to make large arrays global as global variables are sent to a less restricted space.
2. You could write your own quasi-dynamic allocation routine using the conditional compilation and compiling from within a running script.
(probably not worth the bother)
If you are interested in knowing how many elements of the array have been actively used at some point in your program that is something your own code will have to do.
A suggestion is to have a counter, integer variable, to increment decrement as array elements are utilized.
Another convention that you could implement for integer arrays would be to designate the element [0] as your counter for that purpose. Just need to dimension one larger than otherwise needed and use the array like it is [1] based. If you don't like having an offset between a 1 based convention and a zero based array this can make things clearer without any significant problems...Even if you don't track the array use using [0].
Another way to determine if elements are used would be to initialize all elements with a value that would not be otherwise used -1, 0, integer's maximum or minimum value (which would effectively reduce the max or min by one in that case) either define the value as NL or MT or make it a global variable of that value. Then you can refer to it much the same as EOF is referred to in file access or NULL is sometimes used when looking at strings.
ie.
#define MT -2147483648
myArray[10001] ; 10000 array elements using it [1] based
proc main
integer cntr
for cntr = 0 UPTO 10001 BY 1
myArray[cntr] = MT
endfor
myArray[0] = 0 ; no array elements not empty
if myArray[2] == MT
termwrites "myArray[2] is empty"
endif
endproc
hope these ideas helped / Happy Halloween DT