Notifications
Clear all
[Closed] Get variable name as string
Page 2 / 2
Prev
Aug 02, 2012 8:08 pm
With my snippet, you don’t have to pass the value as argument, only the name.
1 Reply
Yes, but you are limited to global variables, which are rare in good scripting practices. Consider the following example:
fn trace variable =
(
assert (isKindOf variable string) message:"Debug.Trace() error: argument \"variable\" is not a string"
variable2 = undefined
try(variable2 = execute variable)catch()
format "% (%): %
" variable (classof variable2) variable2
)
fn myFunction =
(
local localVar = 2
trace "localVar"
)
myFunction()
Page 2 / 2
Prev