Forum Discussion
TheEndless
14 years agoRoku Guru
Sure. Eval() runs in the context of the channel, so anything executed in your Eval'd string will apply to the variables in the running app.
For example:
should output to the console:
Likewise, since BrightScript supports anonymous functions, the following should produce the same results:
Note, the colons are used strictly for brevity in the example. The string you're Eval'ing can have carriage returns.
For example:
testVar = 100
print "Before:"; testVar
Eval("testVar = 0")
print "After:"; testVar
should output to the console:
Before: 100
After: 0
Likewise, since BrightScript supports anonymous functions, the following should produce the same results:
testFunc = Function()
Return 100
End Function
print "Before:"; testFunc()
Eval("testFunc = Function():Return 1:End Function")
print "After:"; testFunc()
Note, the colons are used strictly for brevity in the example. The string you're Eval'ing can have carriage returns.