Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return value of NewObject()
Message
From
24/04/2002 11:02:00
 
 
To
24/04/2002 10:50:45
Beth Wetherbee
Virginia Beach Public Schools
Virginia Beach, Virginia, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00648685
Message ID:
00648694
Views:
19
Hi Beth.

>Can someone tell me why This.NewObject() would return a .T. even if the object being created by NewObject did not instatiate?

The VFP Help file doesn't indicate any return value for the NewObject method, so I'm guessing that it always returns .T. I agree that it would be nice if it returned .F. if the instantiation didn't work, but in the meantime, you can use code like the following instead:
This.NewObject('NewMember', ...)
if type('This.NewMember.Name') = 'C'
* object was created
endif
Doug
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform