I have a class that I'd like to access it's methods from many different subs and functions. Is there a way to globally assign MyClass? (ie: GLOBAL Stuff AS NEW MYCLASS ) Or do I have to always LET Stuff = CLASS "MyClass" in every sub and function of my application?
Announcement
Collapse
No announcement yet.
Globally assign Class?
Collapse
X
-
Try making your Interface global and then you only have to do the Class assignment once, preferably in PBMAIN.
Code:Global Stuff As StuffInterface Function PBMAIN() As Long LET Stuff = CLASS "MyClass" End Function
Paul Squires
FireFly Visual Designer (for PowerBASIC Windows 10+)
Version 3 now available.
http://www.planetsquires.com
-
If its possible, (and probably is, but I wont go there), Depending on your application, it may be more advisable to keep local (as MCM would say under "Procedural" code), but thats just me spouting off a thought
Objects and COM are way too new for me to mess with (without my trappings of a VB background to give a REAL answer) but gut feeling tells me to follow the PB examples and learn from those to try and avoid a "VB Train of Thought"
Engineer's Motto: If it aint broke take it apart and fix it
"If at 1st you don't succeed... call it version 1.0"
"Half of Programming is coding"....."The other 90% is DEBUGGING"
"Document my code????" .... "WHYYY??? do you think they call it CODE? "
Comment
-
Hi Bill - no problem..... and welcome to the Community!Paul Squires
FireFly Visual Designer (for PowerBASIC Windows 10+)
Version 3 now available.
http://www.planetsquires.com
Comment
Comment