I’ve noticed that gotoif doesn’t work if I store the label name inside a variable, but gotolabel works fine under the same circumstances. I provided a small test macro below to show what happens with both, is this a bug or am I missing something?
{
"Name": "TEMPORARY 2",
"CreationDate": "2021-10-9",
"Commands": [
{
"Command": "store",
"Target": "medium",
"Value": "!replayspeed",
"Description": ""
},
{
"Command": "store",
"Target": "Test1",
"Value": "Label1",
"Description": ""
},
{
"Command": "gotoLabel",
"Target": "${Label1}",
"Value": "",
"Description": ""
},
{
"Command": "echo",
"Target": "skipthis",
"Value": "",
"Description": ""
},
{
"Command": "label",
"Target": "Test1",
"Value": "",
"Description": ""
},
{
"Command": "store",
"Target": "Test2",
"Value": "Label2",
"Description": ""
},
{
"Command": "store",
"Target": "1",
"Value": "Skip",
"Description": ""
},
{
"Command": "gotoIf_v2",
"Target": "${Skip} == 1",
"Value": "${Label2}",
"Description": ""
},
{
"Command": "echo",
"Target": "skipthis",
"Value": "",
"Description": ""
},
{
"Command": "label",
"Target": "Test2",
"Value": "",
"Description": ""
}
]
}
That said, you just said GotoLabel doesn’t work with a $variable as destination, it actually does (and I’m very happy about that), so was it not supposed to? I strongly believe that flow control should support $variables as much as possible so that blocks of code can be reused in different parts of the macro without having to write it out every time. For example: I put an error handling block inside an if statement that has 1<0 as the condition, a label to get in and a gotolabel with $destination to get out, so that when it gets executed it deals with the error and goes back to where it came from to continue the rest of the macro as if nothing went wrong in the first place