How to use named variables

Hi All, I’m rewriting a few macros and wanted to use named variables for better readability. All I could find about it was here and so far I tried the following:

setVar foo (1 + 3)
setVar foo (7/3)
setVar foo (20)
$setVar foo (20)
setVar foo 20

None of the above worked. All I get is an ‘ERR’ on the keyboard display.
What am I doing wrong?

P.s. I’m using firmware 10.1.0

That’s the problem. Named variables have not been released yet and certainly are not supported by 10.1.0 firmware.

Hi Karel, thanks for your answer. I got the idea from UltimateHackingKeyboard / firmware /doc-dev/ reference-manual.md (section Named Variables, on master branch) - direct link

Am I looking at the wrong document?

Now that i wrote it down, I could spot my mistake. I shouldn’t read from master, but use the tag of the current firmware… Sorry, my bad

No problem, this is more my mistake than yours, since I am usually linking the living versions of those documents… :sweat_smile:

Also note the user guide at https://github.com/UltimateHackingKeyboard/firmware/blob/master/doc-dev/user-guide.md (again live document, which means, ignore named variable section; rest of it should be pretty much valid).

Yes, docs go along with the corresponding software release. I got that mixed up too in the past, just the other way round: I was looking at a tag instead of master and was wondering why a new command was not documented :wink: