Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AddProperty Vs NewObject
Message
From
05/01/2009 11:14:19
 
 
To
05/01/2009 07:10:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01370969
Message ID:
01371041
Views:
19
This message has been marked as the solution to the initial question of the thread.
>Hi,
>
>When I need to add an object to a form I can either:
>
>
THIS.ADDPROPERTY([oBjName], NEWOBJECT([ClassName], [cVcxSpec]))
>
>or
>
THIS.NEWOBJECT([oBjName], [ClassName], [cVcxSpec])
>
>I try to study the object added both ways in the debugger and I really can't figure out what is the difference between the two...
>
>Technically, is there any difference in the above?
>What should I consider when trying to choose either of the ways?

With ADD/NEWOBJECT the object become a parent member ( Added to the Parent.Objects collection )
- Any external reference to the member, stop the interactive destroy of the parent object ...
- VFP draw only member objects
- Parent.Refresh() call Member.Refresh()

With ADDPROPERTY it is a reference to the object only, like a variable; nothing more than that.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform