Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........
Started by Guilect, May 25, 2010, 07:46:46 AM
0 Members and 1 Guest are viewing this topic.
global myClassdef myClass as cClass ' $main must be before this line if you have a constructor or virtual methods in cClass.
extern myClass as cClass
Quote from: Guilect on May 25, 2010, 01:30:22 PMFor examples sake, if I were to declare 50 global variables in main.eba, I would hate to have to pass them all as parameters to a subroutine in which I want to use them. It seems to defeat the idea of being global.Regards.
' main$INCLUDE "class decl.inc"GLOBAL myClassGLOBAL myClass2$maindef myClass as cClassdef myClass2 as cClassdeclare Extern externalsub()' set foo to 44myClass.setfoo(44)' prints 44print myclass.getfoo()' set foo to 43myClass2.setfoo(43)' prints 43print myclass2.getfoo()' call same routine as above but now from external SUB' get 0, not 44 ???externalsub()WAITCON
' secondary$INCLUDE "class decl.inc"EXTERN myClass as cClassEXTERN myClass2 as cClassGlobal sub externalsub() print myClass.getfoo() print myClass2.getfoo()endsub
projectglobal "on" int blahprojectglobal "off"
def myClass as cClass