Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Basic confusion
Message
From
15/12/1999 13:33:03
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00303899
Message ID:
00304210
Views:
32
>>>>If the variable is declared as private, and initialized (or passed using the PARAMETERS statement rather than LPARAMETERS) in the code that calls the REPORT command, it will be visible to the report.
>>>
>>>George,
>>>
>>>I recently learned here that this is also true for LOCAL variables, the report can see those too.
>>
>>This should have been obvious to me, but I got burned by this.
>>
>>A simple example.
>>
>>LOCAL A
>>A = 4
>>?A && SHOWS 4
>>DO B WITH A
>>?A && SHOWS 5
>>
>>PROCEDURE B
>>LPARAMETERS A
>>A=5
>>
>>The overriding fact is that your are passing by the variable by reference.
>
>Hi Dan,
>
>Yep, that'll happen. It's once of the reasons why I never, ever make modifications to incoming parameters, regardless if it's a procedure or a function, unless it's the express intent of the program code to do so.

That's true. My tendency has always been to store the parameter to a local variable, if I wanted to change it. I had forgotten why I was doing that, but that's definitely the reason.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform