Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
.NewObject vs. .AddObject
Message
From
08/05/2002 08:26:22
 
 
To
07/05/2002 03:06:50
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00653381
Message ID:
00653920
Views:
23
This message has been marked as a message which has helped to the initial question of the thread.
Hola Jose Luis

Te adjunto el texto que al respecto aparece en el libro "Hacker's Guide to VFP 6.0" de Tamar Granor y otros.

Quote

AddObject and NewObject (added in VFP 6) are similar, but NewObject doesn't require SET CLASSLIB or SET PROCEDURE first. The difference between these two is quite similar to the difference between CreateObject() and NewObject(). We suspect, as in that case, that we'll find ourselves using NewObject() more and more, once we remember to do so.

NewObject() also offers the opportunity to add objects based on classes built into APP or EXE files, without having to have the library available as a separate VCX or PRG.

At runtime, the object added to the container always has Visible set to .F., even if you explicitly set it in the object's Init. This lets you do all the fiddling around you need with the new object before it becomes visible, so the user doesn't see what's happening. To ensure the display does not update until all changes are made, you can also toggle the form's LockScreen property.

Because these methods work at design time as well as runtime, they're extremely useful in Builders. You can get the user's input, add the appropriate objects and set them up the way the user wants. For more on Builders, see "Builders and Wizards and Bears, Oh My!" on the book's CD.

Don't confuse these methods with the ones used to add items to a list or combo box.

Unquote

Saludos
Rafael Copquin
Treasurer - Microsoft Users Group of Argentina (MUG)
www.mug.org.ar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform