Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it a good practice when method has no return?
Message
 
 
À
11/04/2008 21:29:42
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01310132
Message ID:
01310140
Vues:
17
>>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.

Thank you for your input.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform