TYPES!! >: (

Blitz3D Forums/Blitz3D Beginners Area/TYPES!! >: (

MattVonFat(Posted 2004) [#1]
Types seem to be the only thing that i cannot understand - most of the coding made sense quite quickly as i have done other languages but types are really confusing to me. I think im almost there with them but im still trying to work out how the "For room.chair = Each chair" bit works.

It says if you have 100 chair in the guide, but wouldnt you have to have a separate "blah".chair for each one?


_PJ_(Posted 2004) [#2]
You assign the 'name' of "room" to your chair Type.

There are separate commands used to work with Types so you don't need a separtae'blah' for each! (That's the kinda point and good thing about them)

the way it works is that you merrily go ahead and just create new 'instances' with the New command. Blitz keeps a track of them all behind the scenes.

when you want to do anything with all of your chairs, you simply use a special For/next loop using 'Each' which tells Blitz you wish to go through all the chairs...

i.e

For room.chair = Each chair
room\x=room\x+1
Next


Hope this helps ;)


MattVonFat(Posted 2004) [#3]
Ok, thanks, so each chair you put in room.chair is stored by blitz so as you add more your not overwriting the previous chair. I think i've just about got it - ill have to create some code that uses it now :P