Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Yet Another VFP6 tip
Message
From
14/07/1998 12:57:06
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00117011
Message ID:
00117228
Views:
12
Hi Jim,

>
>VFP6 includes the new function NewObject() which can be used in place of CreateObject(). What's the benefit, the NewObject() function will take the class library as an agrument eliminating the need to SET CLASSLIB before you create the object. The syntax for NewObject() is listed below.
>
>
>NEWOBJECT(cClassName [, cModule [, cInApplication ;
>          [, eParameter1, eParameter2, ...]]])
>
>
>The arguments are;
>
>cClassName is the name of the class to uyse in creating the object
>cModule is the name of the class library or prg in which the class
> is defined
>cInApplication is the app or exe file that contains the class
> definition
>The rest are optional parameters that will be passed on to the object's Init
>
>This function saves a lot of code when creating objects. You don't need to open all classlibs in the startup program yet you can create objects from those libraries by using the NewObject function.


Very cool tip, Jim. Anything which eliminates SETs is cool by me.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform