yes, in WH 2.0 there are some troubles with accessing outer context from
inside the function. That's because in WH 2.0 there is no true hierarchical
context. If I remember correctly in WH 2.0 there is a hack for this issue -
from a function you may use "caller." prefix to access the outer context
variable. Consider the example below.
<var-defname="x"/><functionname="f"><varname="caller.x"/><functionname="k"><varname="caller.caller.x"/></function><callname="k"/><!-- OK --></function><callname="f"/><callname="k"/><!-- THIS WILL BREAK as from inside function K variable X will be accessible as "caller.x" instead of "caller.caller.x" -->
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hello
Is there a way to test if a variable is defined in a function to avoid the bug
in sys.isVariableDefined ?
Thank's
not sure I understand what bug you are talking about. sys.isVariableDefined
does exactly what it's meant to do. At least it is so in WH 2.1
sorry I was not very clear...
from a function I was trying to test a variable defined outside the function
and not passed as parameter with the 2.0 version, but it wasn't working.
yes, in WH 2.0 there are some troubles with accessing outer context from
inside the function. That's because in WH 2.0 there is no true hierarchical
context. If I remember correctly in WH 2.0 there is a hack for this issue -
from a function you may use "caller." prefix to access the outer context
variable. Consider the example below.