Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return values and other standards
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Return values and other standards
Divers
Thread ID:
00154804
Message ID:
00154804
Vues:
62
I recently learned the C programming standard for method return values:
0 if the method completed successfully,
<0 the method encountered some internal error, and
>0 the method encountered some application error.

I was wondering how people implemented "Get" methods.

You can stick to the approach above and return the appropriate property value in a parameter passed by reference, but this is an awkward interface for the UI.

If you don't use this approach, then how do you tell the UI an error occured? I suppose you could return either the property value or some special value to indicate an error, but this also creates a "muddy" interface for the UI-- for example, the property value could be a different type than your error return value.

Thanks.

- Mark
----------
Mark Bucciarelli
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform