array of type variable?
BlitzMax Forums/BlitzMax Beginners Area/array of type variable?
| ||
Trying to do the following: Type character End Type |
| ||
what? |
| ||
There shouldn't be anything stopping you from doing that. |
| ||
Well, looking at the topic, I'd assume he was wanting an array of his character type. If that's the case, you need to do it like this.Type character ... define type End Type Local CharacterArray:character[10] For Local t:int = 0 to 9 CharacterArray[t] = New character Next You need to loop through each element of the array and create the type because BlitzMAX doesn't do that for you. |
| ||
or local CharacterArray:character[] = new character[10] |
| ||
But you would still need to loop through the array. According to the docs, the array elements are initialized to Null Arrays may also be created 'on the fly' using the syntax: New ElementType[Dimension1,Dimension2 etc...] This returns an array of the specified dimension(s) with each element initialized to Null. |