What is aa%[...]

Blitz3D Forums/Blitz3D Beginners Area/What is aa%[...]

JBR(Posted 2003) [#1]
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


Ross C(Posted 2003) [#2]
There called blitz arrays. They can only exist(i think) in types and can only be one dimentional. Also they cannot be redimentioned.


Gabriel(Posted 2003) [#3]
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.


JBR(Posted 2003) [#4]
What are the benefits of using blitz arrays [] versus the normal () arrays?

Marg


GfK(Posted 2003) [#5]
normal arrays don't work in types. blitz arrays can't be multi-dimensional.


soja(Posted 2003) [#6]
(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)


Loocipher(Posted 2003) [#7]
In other words Blitz arrays act like a normal variable rather than an array. The only difference is they can hold multiple values.


JaviCervera(Posted 2003) [#8]
And they are insanely slow!!!


Beaker(Posted 2003) [#9]
They aren't slow, but freeing many blitzarrays inside Type objects can be.