Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need an example for the GetRegKey() in registry.vcx
Message
De
24/10/2001 11:43:19
 
 
À
24/10/2001 11:00:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00572563
Message ID:
00572657
Vues:
37
Peter,
I'm glad it works.
The @ in front of a parameter means that you pass the parameter by reference. Many API functions require parameters to be passed by reference. What this means is that the called function will have access to the parameter passed. Any changes made to the parameter will affect the calling parameter. In your case, lcOptValue will be updated with a return value. The following illustrates the difference between parameters passed by value and by reference:
lcPara = ""
?test(lcPara) && returns 0
?lcPara && returns ""
?test(@lcPara) && returns 0
?lcPara && returns "Changed by Test.prg"

FUNCTION Test
LPARAMETERS tcStr
tcStr = "Changed by Test.prg"
RETURN 0
>>Peter,
>>I'm using the following GetRegKey() function. It may give you some ideas.
>>Snip
>
>Daniel,
>
>First the good news, as you well know, it works.
>Now the bad news: I only understand part of what makes it work.
>
>
>lcOptValue  = ""
>lnErrNum    = oReg.GetRegKey(tcOptName, @lcOptValue, tcKeyPath, lnUserKey)
>
>
>It's the @lcOptValue that has me in spades. Is it always empty? And why pass it with @?
>
>Oh, and BTW, to all of you, thanks for educating me!
Daniel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform