Information générale
Catégorie:
Codage, syntaxe et commandes
If CREATEOBJECT() fails for any reason other than the Init returning false, I would certainly expect an error message. Something like "Insufficient Memory" - something related to the reason that it failed. To suggest otherwise implies that VFP shouldn't really report any errors at all.
I agree that if the Init returns false, then it's up to the programmer to handle that. But if CREATEOBJECT() simply doesn't create the object, how am I to determine why? And why should I have to test the variable after every single CREATEOBJECT() statement? I don't think that's a viable solution at all.
>CreateObject() won't generate an error if it fail, it will return NULL. Make sure that you test that the variable isn't NULL after each CreateObject().
>
>One reason that could explain the problem is that the class return .F. in it Init() event.
>
>HTH
>
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement