Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return .f. in Init Fox Equivalent
Message
 
To
11/01/2006 20:48:54
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
ASP.NET
Category:
Class design
Miscellaneous
Thread ID:
01085894
Message ID:
01085927
Views:
13
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform