BUG: Variable Passed/Declared as PRIVATE in UDF Not ReturnedID: 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: 1. A variable is passed by reference to a UDF or PROCEDURE such as 2. The passed variable is received in the UDF or PROCEDURE PARAMETER
3. A variable with the passed name is declared locally in the UDF or
4. A READ is executed against the PARAMETER variable.
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.
NotesAny of the following will allow the value of y to return to x properly:
|
|
Last Reviewed: June 27, 1995 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |