Global variable inside type exist when discarded.

BlitzMax Forums/BlitzMax Programming/Global variable inside type exist when discarded.

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.

No. Globals inside a type are actually specific to an instance of the type, but the type itself. For instance:

Type Class
 Field Blah
 Global GlobalVar=5
EndType

Class.GlobalVar=3 'Yes, you can do this
Print Class.GlobalVar

Instance:Class=New Class

Print Class.GlobalVar


This is actually one thing the docs cover.