|
![](/i/fill.gif) |
I am creating an array in one macro, and using it in another. The macro
which creates the array surrounds it with a conditional, which results an an
array of variable size, so when I try top loop against it (expectedly)
subscript out of range errors occur.
This would not even be an issue were there an array.length() function.
So what I have tried to do is increment a variable within the conditional
which populates the array which is then used within an if block just before
the i=i+1 like this: [which forces random tests to be performed beyond your
estimate, until your desired array length is reached]
// Check if required array length has been reached, if not, increment
counter until it has
#if (checkLength = requestedLength-1)
#debug "Required Array Length Reached, now exiting... \n"
#else
#if (ctr > 5000)
#debug "Ceiling has been reached; Preventing infinite loop, now
exiting... \n"
#else
#set ctr=ctr+1;
#end
#end
Is this the best I can hope for? Is there some other way to detect the
populated length of an array? dimension_size is *useless*. Might it be that
I am forced to form the array within the loop which uses it? That would
suck...not very OO...but then SDL isn't very OO to start with, ironically..
ian
Post a reply to this message
|
![](/i/fill.gif) |