What is aa%[...]
Blitz3D Forums/Blitz3D Beginners Area/What is aa%[...]
| ||
Hello, Just looking through someones program and the line Local aa%[ .... ] appears then aa[ val ]= ... I know arrays use round brackets, so what do the square ones mean? Thanks Marg |
| ||
There called blitz arrays. They can only exist(i think) in types and can only be one dimentional. Also they cannot be redimentioned. |
| ||
They can only exist(i think) in types No, they don't have to be in types. They're useful in types though. They're useful in self-contained functions too. |
| ||
What are the benefits of using blitz arrays [] versus the normal () arrays? Marg |
| ||
normal arrays don't work in types. blitz arrays can't be multi-dimensional. |
| ||
(taken from my post in another thread) Normal array, e.g. Dim Array%(10) 1) global 2) can't be used in custom types 3) can't be passed into/returned from functions 4) can be multi-dimension 5) faster than... "BlitzArrays(TM)", e.g. Array%[10] 1) global or local 2) can be used in custom types 3) can be passed into and returned from functions 4) slower than normal arrays 5) can only be one dimension 6) undocumented (meaning that the implementation may change, so don't rely on them to always be there...officially) |
| ||
In other words Blitz arrays act like a normal variable rather than an array. The only difference is they can hold multiple values. |
| ||
And they are insanely slow!!! |
| ||
They aren't slow, but freeing many blitzarrays inside Type objects can be. |