The use of $ in front of variables is different in different languages.
Some languages just use a $ in front of a variable to denote that it is a variable, e.g. Perl, PHP, etc. You use the $ even when setting a variable, e.g. $var = 1;
In other languages, the $ is in fact a dereference, e.g. in Unix shell. You set a variable using set var=value and you read it using $value. You don’t use set $var=value because that would mean: get the value of var, use that value as a variable name, and set that variable to value.
MikroTik scripting language seems to be in the middle. Its manual clearly says that values are set using the variable name, not $variable:
:set myVar “my value”;
:put $myVar;
However, when using this:
:set $myVar “other value”;
it works the same way! apparently it accepts both forms in this case.
However, when variable is an array, it works only with the $ sign!
:set Array {{});
does nothing. But:
:set $Array ({});
correctly clears the array. similarly, setting an array member value:
set ($Array->“index”) 1;
the $ is required.
I think this is a bug or it is misleading.