Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need an example for the GetRegKey() in registry.vcx
Message
From
24/10/2001 11:43:19
 
 
To
24/10/2001 11:00:51
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00572563
Message ID:
00572657
Views:
40
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
Previous
Reply
Map
View

Click here to load this message in the networking platform