Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NewObject() vs AddObject()
Message
From
12/02/2008 21:26:06
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
12/02/2008 21:17:57
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
01292009
Message ID:
01292012
Views:
22
>>I can't quite grok the help, and in actual practice I have only used AddObject (as well as CreateObject()). Is there any difference in behavior between the two functions - NewObject() and AddObject() - apart from the slightly different syntax (for instance, NewObject allows specifying a class library)?
>>
>>TIA,
>>
>>Hilmar.
>
>NewObject() is the equivalent of CreateObject() except that CreateObject() requires that you have either the PROCEDURE file or CLASSLIB set. Addobject simply creates a property to which you can assign the new object
>SET PROCEDURE TO myProc
>this.addproperty("newProp",CREATEOBJECT("myclass_in_myproc"))
>
>SET PROCEDURE TO
>this.addproperty("secondprop",NEWOBJECT("myclass_in_myproc","myproc.prg"))
Sorry, but aren't you confusing AddObject() with AddProperty()?
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform