V
V
Vitaly2016-10-28 22:30:12
Mikrotik
Vitaly, 2016-10-28 22:30:12

How to reassign the contents of a global variable in Mikrotik?

All the best!
Something I can’t figure out with global variables in mikrotik, either skiing, or I’m doing something wrong ...
If you work with global variables in the console, then everything is OK, no questions asked, but as soon as I put them into the script, it starts confusion.
src of a primitive script:
:global myVar "up" ;:put $myVar
if you call it later, it will display

up
because if you look through the browser, then the system changed the script to:
:global myVar "up" ;:put "up"
and if you correct it to
:put $myVar
then it doesn't work :(
How to change the values ​​of a global variable correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bubnov, 2016-11-03
@d11

:global myVar; :set $myVar up ;:put $myVar

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question