Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it a good practice when method has no return?
Message
From
11/04/2008 21:29:42
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01310132
Message ID:
01310136
Views:
15
>Good evening,
>
>I have some form methods that don't return anything (actually they probably return .T. by default, but it does not matter). The way I call a method like this is as following:
>
>
>=thisform.mymethod()
>
>
>Is anything wrong with the above syntax?

I don't see any problem with that.

When calling a method, if you need a return value, then store it to a variable. Otherwise, there is no reason to ask for a return value. And I don't see any reason, either, to specify a return value when none is needed.

Some methods that don't return a value MIGHT be changed to return a value, for example, to indicate success or failure. But that should be done only when it is needed, not because every method has to have a return value - which it doesn't.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform