A question about types
Blitz3D Forums/Blitz3D Beginners Area/A question about types Yea?
but generaly thats not how types work.. more like this:
but generaly thats not how types work.. more like this:
Graphics 300,500,16,2 setbuffer backbuffer() type person field Hello$ end type Bob.person = new person Bob\Hello="Hello" Joe.person = new person Joe\Hello="Yo Wazzup?" Dumbguy.person = new person Dumbguy\Hello="Duhh..." Print "Dumbguy's Hello: "+Dumbguy\Hello Print "Joe's Hello: "+Joe\Hello Print "Bobs Hello: "+Bob\Hello delay 5000
Well, this is why I want to do it:
http://www.blitzbasic.com/Community/posts.php?topic=69694
I want to complete this in as very little code as possible.
http://www.blitzbasic.com/Community/posts.php?topic=69694
I want to complete this in as very little code as possible.
Types can't have default values in Blitz3D, can they?
Types can't have default values in Blitz3D, can they?
No, they can't - although, I think the compiler allows you to put 'Field a=1' etc., it just doesn't have any effect. The compiler lets you, but sometimes it bugs up and requests a file to open if you give a custom function eg
type box
field contents% = CreateList%()
end type
type box
field contents% = CreateList%()
end type