Super.Global

BlitzMax Forums/BlitzMax Beginners Area/Super.Global

I don't think so. It would go against logic to be able to create a global from with a function, but there may be a way.

What I tend to do is something like this :

Type MyApp
   Field MyGlobals:TGlobal

   Function InitOneWay()
      MyGlobals=New TOneWayGlobals
   End Function
   
   Function InitAnotherWay()
      MyGlobals=New TAnotherWayGlobals
   End Function
End Type


Type TGlobals Abstract
End Type

Type TOneWayGlobals Extends TGlobals
End Type

Type TAnotherWayGlobals Extends TGlobals
End Type


I figure that probably doesn't need an explanation. There's no way of telling if it's suitable for your purposes, but it's suitable for mine, and it sounds like a similar problem you're trying to solve.