Type in a type

Blitz3D Forums/Blitz3D Beginners Area/Type in a type

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

You cant do

sheep\b1.badger = new badger

because if your sheep is

Type sheep
Field b1
field b2
Field b3
End type

you have already declared b1 to be an int

if however the fields were
Field b1.badger

you still cant do that because you have already declared the field type to be a badger and therefore dont need to
*edit* oh apparently you can becuase gitTechs code does exactly that, however you dont need to */edit*
the correct syntax in this instance would be

sheep\badger = new badger
(because the compiler already knows that sheep contain badgers)

Types can quite happily be created inside functions as I have already demonstrated and you dont need to rely on the internal lists of types provided by blitz

my code above is quite elaborate but its like that to show you that you can reduce the main program to just a few function calls. Yes, I am breaking my own rules on "good form here" (posted in another thread) but umm who in the world strictly practices what they preach :D