Community discussions

MUM Europe 2020
 
ckgth
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 64
Joined: Wed Jun 06, 2007 5:03 pm

Word is in Model

Wed Apr 02, 2014 10:47 am

Hi there,

why:

:global model [/system routerboard get model]
:if ( "SXT" in $model ) do={ :put "SXT-is-in-da-house";} else={ :put "no-SXT";}

not working?
Can everyone please help?

best regards
christian
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5955
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Word is in Model

Wed Apr 02, 2014 11:27 am

:if ($model~"SXT") do={...}
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 2950
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: Word is in Model

Wed Apr 02, 2014 1:19 pm

Hi there,

why:

:global model [/system routerboard get model]
:if ( "SXT" in $model ) do={ :put "SXT-is-in-da-house"; } else={ :put "no-SXT"; }

not working?
Can everyone please help?

best regards
christian
I suggest:
1) to use full syntax;
2) not use less understandable syntax like "~", and non english keyboard do not have this symbol, and on terminal ALT+123 not work.
:global model value=[/system routerboard get value-name="model"];
:if ([:find $model "SXT" -1] >= 0) do={ :put "SXT-is-in-da-house" } else={ :put "no-SXT" }
I'm Italian, not English. Sorry for my imperfect grammar.

Who is online

Users browsing this forum: No registered users and 11 guests