Greetings!
Consider the following code:
PUBLIC globalVariable as Boolean
PUBLIC global2
LOCAL result as Boolean
globalVariable = .f.
result = someFunction(@globalVariable)
MESSAGEBOX(TRANSFORM(globalVariable))
RELEASE ALL
FUNCTION someFunction
PARAMETERS someVariable
LOCAL functionResult
someVariable = .t.
RETURN .f.
ENDFUNC
The purpose of someFunction is to change the variable it receives. If the
calling program decides it wants the change to be kept, it can pass the
variable in by reference, as shown. But if the argument to be changed is a
global variable, then the global variable is not accessible inside
someFunction!
When I step through this code, I see that globalVariable and variable2 are
both defined before someFunction is called. When I step into someFunction,
the debugger suddenly says "Expression could not be evaluated" for
globalVariable! Why is this?
Thanks very much!
Rob