How to get array length

Blitz3D Forums/Blitz3D Programming/How to get array length

I want to run a process on every member of an array

For n = 0 to ArraySize(array())
If such and such
do groovey things
Next

I can't find any GetArraySize function though. Is there any? Or can I use a 'If index not out of array bounds' method? Or do I need to add *another* Global constant?!

Global constant only I'm afraid.

I'm afraid you'll have to use a constant or variable to store the size of the array.


EDIT: Beaker was 11 seconds faster :P

You could use a trick: always store the dimed size in array index zero.

Nice trick :)

You could use a bank instead of an array, which has a corresponding BankSize command.