Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return .f. in Init Fox Equivalent
Message
 
À
11/01/2006 20:48:54
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
01085894
Message ID:
01085927
Vues:
15
This message has been marked as a message which has helped to the initial question of the thread.
>>Could you please explain what you are trying to accomplish?
>>I can't remember exactly what returning .F. from an init in VFP does.
>>Are you trying to stop the object from being instantiated?
>>Einar
>
>return .F., in an Init() method in VFP, will avoid an object from being instantiated.
>
>Examples, in VFP:
>
>
>* Form.Init()
>if gnUserLevel >= 3
>  MessageBox("You are not authorized to view this form.")
>  return .F. && The form doesn't show.
>endif
>
>
>
>* TextBox.Init()
>if (some condition)
>  return .F. && The TextBox never appears on the form.
>endif
>
Scott,
That is what I thought but I wasn't 100% sure.

Throwing an exception from within the constructor will cause the object not to be instantiated.
throw new Exception("I don't want this object to be instantiated.");
If you explain a little further what you want then we might be able to find more ways to skin the cat.

Einar
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform