Community discussions

MikroTik App
 
netmaster
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 68
Joined: Thu Jan 05, 2006 11:42 am

how to escape unknown commands

Mon Oct 21, 2013 2:08 pm

I want to use "/export compact" on automatic backup when ROS version supports it, but
:if ([/system resource get version] > "5.11") do={/export compact} else={/export};
expected end of command (line 1 column 59)
give error on ROS version 5.6
Indeed, command "/export compact" is not supported on this version, but its not needed to ...
 
User avatar
skot
Long time Member
Long time Member
Posts: 584
Joined: Wed Nov 30, 2011 3:05 am

Re: how to escape unknown commands

Tue Oct 22, 2013 8:13 pm

Use [:parse] to create a function, something like this:

ros code

:if ([/system resource get version] > 5.11) do={
  :global runExport [:parse "/export compact"];
} else={
  :global runExport [:parse "/export"];
}
$runExport;
 
netmaster
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 68
Joined: Thu Jan 05, 2006 11:42 am

Re: how to escape unknown commands

Wed Oct 23, 2013 11:20 am

thank you, that works ...

Who is online

Users browsing this forum: Bing [Bot] and 35 guests