This works, if I use the "expression" keyword... as it expects the "label ID" to be in quotes. So, the variable is essentially "test", where I say...
call expression x pass (count = 3)
However, I can't get this to work, without the inclusion of the "expression" keyword. Thus, this fails...
call x
Script error: Could not find label 'x'
Naturally, I know that "call" expects a label-ID without quotes, which is similar to "pass by reff/pointer", but I don't know how to do that. Honestly, it should work with a direct "reff/pointer", as well as a "string". But, then again, so should the use of the call with the "expression" keyword.
So, if this is not a "bug", then how would I manage this specific use of "call" and "label". (Adding a note to the help files may solve a few issues, if there is only one specific way to do this. Having each variant of the same exact "call" statement, is kind-of a hindrance.)
RAW CODE:
Code: Select all
label test:
"TEST JUMP"
$ x = "id_0"
call expression x pass (count = 3)
"END 1"
call x
"END 2"
return
label id_0(count=1):
"ID 0: Some text [count]"
return
Honestly, in the future, I would set it up as just one format, which handles both "quoted_text", or variables. The word "expression", being removed. If there is a "(" following the label-ID, that is obviously an expression, which should be optional. As opposed to making two individual uses of the same function "call", which do not operate in similar ways and have specific, unique demands to operate them.
EG... (Expected use. Would also remove the redundant need of the extra "help listing" for using "expression", with call.)
Instead of this...
call expression "shoe" (frog = 1)
We "expect" this...
$x = "shoe"
call x
call "shoe"
call x (frog = 1)
call "shoe" (frog = 1)
Should all function the same way. Just one actually has the optional "expression" to pass.
Just as you use "label", which is "expected".
label test:
label test (frog = 1):
Both are variants of the same command...
We don't use...
label expression "test" (frog = 1):