Community discussions

MikroTik App
 
adam900331
newbie
Topic Author
Posts: 34
Joined: Fri Jul 22, 2016 10:02 am

Value use more than one script

Sun Jan 13, 2019 8:35 pm

Hello!

How can I use a value on more then one script?

I done a following script:
:global currentTime [/system clock get value-name=time]
And when I want to use the currentTime value on another script:
:log info $currentTime
There isn't happens nothing, the script don't write the value of the currenTime in the log.

Thank You!
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3279
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Value use more than one script

Mon Jan 14, 2019 8:48 am

You need to declare the global value in your script. Even if its used before.
:global currentTime
:log info $currentTime

Who is online

Users browsing this forum: GoogleOther [Bot], infabo and 36 guests