Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning value from a Method
Message
De
06/02/2007 07:34:13
 
 
À
05/02/2007 20:47:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01192623
Message ID:
01192709
Vues:
14
>>Question: can I return a value from a Method? If so, how would I reference the returned value?
>
>Several ways to return a value -- if only single value, then you can use the method by Dan Freeman. You can pass the parameters to the method by reference:
>
>
>MyVar1 = ""
>MyVar2 = 0
>thisform.MyMethod(@MyVar1, @MyVar2, ...)
>...
>? MyVar1
>? MyVar2
>
>
>the @ sign passes the parameter by reference, any value assignment in the method is returned to the calling program. You can also pass an object with properties:

Don't forget you can equally pass params by value:

lcFirstName = thisform.ParseFirstName( lcFullName)

...
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform