Hello Michael!
14 Mar 97 23:52, Michael Dougherty wrote to Den Barnes:
MD> The screen control (@ GET) calls a procedure, which conditionally
MD> calls another procedure to do the specific work in each case.
MD> When the working procedure tries to reference the global
MD> variable, the procedure works the first time it is entered- but
MD> the second time the procedure is called, the program halts
MD> because the variable (my public constant) cannot be found. Debug
MD> shows no value just after control passes to the procedure (the
MD> second time)
Do you give the public variable as a parameter to a procedure? In that case,
the original variable becomes hidden to the calling procedure and all
procedures that are called within. Very bad, for a public declared variable.
What you can do to find the problem, is to put the variable in you debug
window, and put a stop on this variable (a bullet in the middle column). When
the variable is not available any more, the program is also stopped. A
solution is, to put () arond any public variable used in a procedure call, so
the variable is passes by value, instead of by reference.
MD> Is there a scoping restriction that makes variables available
MD> only to immediate child procedures, but not grandchildren? Is
No, there isn't.
MD> parameters? (possibly something like VBa (Excel 5.0)
MD> "ParamArray")
Such a solution is not available.
Groetjes,
Wim
Fido: 2:281/554.11 CompuServe: 100142,604
Internet: wdelange@biochem.nl wdelange@pi.net
--- GoldED 2.42.G1121
---------------
* Origin: WiMar Soft (2:281/554.11)
|