#NULL wrote:Marc56us wrote:For Arrays, in PB low() are always 0
There are some exceptions. JSON/XML extracted arrays can be empty. Global arrays declared in a procedure that is not called are also empty.
It still works: ArraySize() returns -1 for an empty extracted array, and a For loop from 0 to -1 simply doesn't execute.
I don't fully understand the original post. If you use ArraySize() or constants/variables for array sizes, you don't need to "adjust loops whenever the dims change".
A feature I would like to see is ForEach to work with Arrays, automatically handling the indexing. (Like a List or Map.)
Code: Select all
Dim Test.i(10)
ForEach Test() ; Notice, no array index.
Test() = Random(100) ; Of course this syntax would only work within a ForEach loop
Next