Dim inside Type possible?

Blitz3D Forums/Blitz3D Programming/Dim inside Type possible?

2 Unlimited(Posted 2015) [#1]
Can we declare something like

Type chair
    Dim variables (10)
End Type



GfK(Posted 2015) [#2]
IIRC, you can't use standard arrays - you have to use Blitz Arrays.

 Type myType
  Field myArray[10]
End Type


Blitz arrays are single-dimension only, so no myArray[10,10]. I'm sure there's some other limitation too.


steve_ancell(Posted 2015) [#3]
I think you can't change the size of a Blitz array once it's defined if I remember correctly.


Matty(Posted 2015) [#4]
Yep....and you can't set the size at runtime either.....my preference is to use a bank in the event I need to use a blitz array.


Rroff(Posted 2015) [#5]
Do you actually need to use the array index number for fast look up - or just want a list of variables (possibly of infinite size) attached to the type?

Its possible to mis-use type collections to have an infinite group of objects owned by a parent object.


2 Unlimited(Posted 2015) [#6]
I use an array having a fixed number of elements


2 Unlimited(Posted 2015) [#7]
Thanks for the extra info guys