Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AddObject or NewObject or what?
Message
From
03/02/1999 17:13:32
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00183607
Message ID:
00183654
Views:
23
>In VFP6, I create an application object that is based on the custom class. This object holds all my app properties such as LoginID, FiscalYear, etc.
>
>Now I have a created a class based on my form subclass. Is there a way to use NewObject() to add this object to oApp? The code below works fine, but I am trying to learn what this new function will and will not do.
>oApp = newobject("AppMgr", "AppManager.vcx")
>set classlib to AppClass.vcx  && different classlib from oApp
>oApp.AddObject("oGPRA", "TravGPRA")
>TIA!

You can use NewObject() in place of CreateObj() and you can use...

oObject.NewObject() in place of oObject.AddObject()

Of course, the difference is that with NewObject you are not required to set classlib to, you just specify the class in the NewObj function/method itself.

You can also, with new object, specify a classlib that is in another .EXE.

BOb
Previous
Reply
Map
View

Click here to load this message in the networking platform