Hi,
I’ve bumped into what I think being a problem with script interpretation. But I’m not sure if it is my interpretation or the compiler one. Here is the context.
I’ve made a Gateway Script (Event Tag Change) in which I defined several functions. Some of them calling others inside the same script.
To make it simple, I’ve lightened the script :
[code]def func1(msg):
return ‘result of func1("’ + msg + ‘")’
def func2(msg):
return ‘result of func2("’ + func1(msg) + ‘")’
print func1(‘test’)
print func2(‘test’)[/code]
Launching such a script in the Script Playground will generate an error :
NameError: global name 'func1' is not defined
Note that the error is generated by the line print func2(‘test’). The line print func1(‘test’) works correctly and outputs the expected result in the Script Playbround.
When I try to execute the same script on online compilers (compileonline.com for exemple), the execution does not cause any error.
Has it something to do with the new global var scoping ?
My Ignition version is 7.7.1
Thank you.