Closed bob2517 closed 3 years ago
Weird - this shouldn't be doing this - spaces are converted to something else before the split. Upgrading issue to weirdness.
This error makes sense now. The func command is correctly receiving this when it is hit - the variable is being converted correctly before reaching the command:
checkVar Hi "dude" 25
The correct func command should include double-quotes like this: func: testMe "{erroring}" {okVar};
The developer is responsibIe for adding the quotes. It means they can convert a number into a string by putting quotes around it, and booleans convert correctly. I should probably actually read my docs. Obviously a bigger note is needed somewhere - put this in:
"Variables are evaluated before reaching action commands. Because of this, ensure all string variables have double-quotes around them where needed when being passed into action commands. Otherwise you could end up with this result... (insert example here)."
Closing.
Actually - even with the double quotes added it was removing the inner quotes. They aren't escaped when evaluated as a variable. So I had to fix something after all...
Fixed on branch - closing.
Docs are updated. Just need to remove the code editor for the example on the website as the code editor doesn't allow JS and we need JS to add an external function into the iframe for the example to work, unless the html will accept a script tag. Trying that now.
It works! The code editor is awesome...
This looks like it could just be a 2.4.0 thing - to repeat:
var: erroring "hi dude", okVar 25; func: testMe {erroring} {okVar}
Brings back pars incorrectly in the function: ["hi", "dude", 25]
Pars in this case should be: ["hi dude", 25]
The func command needs an alternative syntax upgrade anyway so that vars can be passed in as object references, but for now just sort this out so it works per this basic syntax.