Community discussions

MikroTik App
 
User avatar
archon
newbie
Topic Author
Posts: 28
Joined: Thu Oct 05, 2006 12:22 pm
Location: Warsaw

Hot to check if variable is defined

Sat Mar 15, 2008 1:43 pm

Hello, my question is as in topic. In MT 2.9 it was easy:
:if ([:len $my_variable] = 0) do={:global my_variable 0}
How to do the same in MT 3.x ?
 
User avatar
Letni
Member
Member
Posts: 376
Joined: Tue Dec 05, 2006 5:16 am
Location: South Carolina

Re: Hot to check if variable is defined

Sat Mar 15, 2008 5:54 pm

You must declare all variables before you use them in V3.

This will make the global variable called my_variable available to the script.
:global "my_variable"
-Louis

Who is online

Users browsing this forum: Gadulowaty and 80 guests