Making a type global?

Blitz3D Forums/Blitz3D Beginners Area/Making a type global?

Farflame(Posted 2005) [#1]
Is it possible to make a type global? How do I do it? Is there some reason they're not automatically global like an array? I'm passing one of my types from function to function and it seems simpler to just make it global. Can it be done?


GfK(Posted 2005) [#2]
Global m.myType

Type myType
  Field X%
  Field Y%
End Type



Sir Gak(Posted 2005) [#3]
Try this:
Type myType
   Field X%
   Field Y%
End Type
m.myType = new myType
Global m.myType

I'm not sure, but you may be able to combine the last two lines, putting Global on the type as you create a new one.