Help with arrays inside types

BlitzPlus Forums/BlitzPlus Programming/Help with arrays inside types

Rico(Posted 2003) [#1]
Sorry, I can't seem to find any information (yet) on how to put arrays inside types. I am using the old 2d Blitz - I know that you can do it, but I can't remember how. I would appreciate it if someone could tell me how to do this. Thank you very much.
Does anyone know if it possible to put multidimensional arrays inside types yet?

The GFXCaps function on my version of Blitz no longer works either - the editor simply doesn't recognise it as a Blitz Command. However it is still featured in the manual. Help!

Rico


Azathoth(Posted 2003) [#2]
Use the '[' ']' instead of '(' ')' ?


rdodson41(Posted 2003) [#3]
Arrays in Types: Use the [] instead of ():

Dim bob(2)
bob(1)=1
bob(2)=2

Type fred
Field x,y
Field jim[1],jim[2]
End Type


GFXCaps: There are a few commands like this. They're just bugs and will probably be fixed soon.


Jeroen(Posted 2003) [#4]
Or solve it by using two types. I'll give an example with "player information" and "item information that the player has", e.g diamonds.

If you know the player id in type 1, you can mutate data in type 2.

Type playerInformation
   Field whichItemsItook
   Field id
   Field entity
End type

; item\whichPlayerID correspondents to playerInformation\id 

Type item
   Field whichPlayerID
   Field whichItemID
End type



Rico(Posted 2003) [#5]
Excellent - now I can get back to my program. Thanks to everyone for the help.