Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to return a value from the :: operator
Message
 
 
To
22/01/2002 21:10:50
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00608748
Message ID:
00608787
Views:
14
Calvin,

As Nadya mentioned, if you find yourself needing to skip the code in the class it's a strong indication that the class hierarchy design has some serious flaws.

You need to tell VFP explicitly that you are calling the method by using parens:

return basecust::Save()

Also note that nodefault does not do what you comment indicates. nodefault stops the VFP baseclass behavior from occuring. Since the VFP baseclass you are working with does not have a native Save() event there is nothing for nodefault to actually do.

Now by putting any code in the method of the grandchild class you are overwriting it and therefore preventing VFP from executing any code you've added to the parentclass or grandparentclass. DoDefault() is used to call into the code you are inheriting.

>I have a clase that is the third level in the class hier. I want to skip the processing in the second level class and execute the code in the base class for a particular purpose. However, the class generates a return value to the form.
>My code is:
>
>nodefault && SKIP PROCESSING IN CLASS ABOVE
>basecust::save && execute base class code.
>
>However basecust::save returns a +1 for success and a -1 for failure and I cant figure out how to get a return value from basecust::save. If I try :
>r=basecust::save VFP generates an error. Help.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform