BUG: Variable Passed/Declared as PRIVATE in UDF Not ReturnedLast reviewed: June 27, 1995Article ID: Q125789 |
The information in this article applies to:
SYMPTOMSUnder the following conditions, the PARAMETER variable will take on the value of the local variable in the UDF when the READ is issued, and the value of the passed variable (x) is never changed in the calling program. This problem occurs if the following steps are taken:
WORKAROUNDAdopt a naming scheme that avoids the problem. For example:
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Steps to Reproduce BehaviorRun the following code, noting the comments as it is stepped through in the Trace Window. Enter 2 into the GET and note that it is not passed back to x in the calling program.
CLEAR SET UDFPARMS TO REFERENCE ACTIVATE WINDOW DEBUG && put X and Y in it. SET STEP ON PUBLIC x x=1 =getx(x) @ 11,5 SAY x && does not change! RELEASE WINDOW TRACE RELEASE WINDOW DEBUG SET UDFPARMS TO VALUE && reset to default FUNCTION getx PARAMETER y PRIVATE x x=4 @ 5, 5 GET y && Y contains the correct passed value, 1 @ 7,5 SAY y @ 9,5 SAY x && local X contains 4 * observe that the GET Y takes on the value of the * local X as soon as the READ is executed. * Enter a new value in GET Y and * observe that the value of Y does not change, * only the local X value changes READ NotesAny of the following will allow the value of y to return to x properly:
|
Additional reference words: FoxWin FoxDos buglist2.50 buglist2.50a
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |