ROS ver script at 6.34

That script was working great before, why it does not work at ROS 6.33.5/6.34???

..
:if ([$ROSver] < 6.34) do={
}

Does not work … what do you mean ? Too many “}” ?

Does not work is “not working”.
But i know where is the problem… when version of ROS is for example 6.33.5 - there is not recognized as older (value smaller) than 6.34. So - how to make it working?

RouterOS doesn’t support floats, and on the line

:if ([$ROSver] < 6.34) do={

you’re trying to use “6.34” as a float… Which IIRC gets converted into the IP address 6.34.0.0 (or was it 0.0.6.34? I can never remember…).

Plus, the “[” and “]” are only when you want to issue a command. They aren’t to be used when referencing a variable.

To properly match the version, you should parse the version vector into separate digits, and compare the individual digits.

But… Rather than doing that, why not just do whatever it is you’re wanting to do, and just use the construct

:do {
} on-error={
};

to handle errors gracefully.

So - how to uise it at my script? I would like to receive info, when ROS is older (or different), than… (declared version).

If “different” is sufficient, you can just replace

:if ([$ROSver] < 6.34) do={

with

:if ($ROSver != "6.34") do={

This would let the “do” section be evaluated if the version is different, i.e. even if it’s newer.

OK, thank You very much boen_robot, but could You tell me how to do with that script to detect only “older version that”? Also with subverions, for instance 6.33.5.