Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return value of NewObject()
Message
De
24/04/2002 15:16:09
Beth Wetherbee
Virginia Beach Public Schools
Virginia Beach, Virginie, États-Unis
 
 
À
24/04/2002 11:02:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00648685
Message ID:
00648831
Vues:
29
>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

Thanks Doug.

It is curious to me that the function NEWOBJECT() does seem to return .F. if instatiation doesn't work but that the method This.NewObject() always seems to return .T.

Anyway, thanks for reassuring me that I'm not going crazy (at least in this particular case <g>).
Beth Wetherbee, MCSD
VBCPS
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform