diff options
author | Christian Hesse <mail@eworm.de> | 2024-09-13 10:16:17 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-09-13 10:22:06 +0200 |
commit | 41b19b045ad98c528ce9d8d84ab086fe7c54f265 (patch) | |
tree | f24a68af49bf101eabc026d9edc85bcc15e1c856 | |
parent | fe52bd4a0a496f896439887c0943e38e8f39ce2c (diff) |
global-functions: $VersionToNum: support "zero"...
... to have a clean way to generate bitmasks.
[admin@mikrotik] > :put [ $VersionToNum 0.255zero0 ]
16711680
[admin@mikrotik] > :put 0x00ff0000
16711680
Once implemented everywhere the internal calculation could be
changed easily.
-rw-r--r-- | global-functions.rsc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/global-functions.rsc b/global-functions.rsc index 41120fd..9ee5312 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1485,7 +1485,7 @@ :global CharacterReplace; :set Input [ $CharacterReplace $Input "." "," ]; - :foreach I in={ "alpha"; "beta"; "rc" } do={ + :foreach I in={ "zero"; "alpha"; "beta"; "rc" } do={ :set Input [ $CharacterReplace $Input $I ("," . $I . ",") ]; } @@ -1496,6 +1496,7 @@ :set Return ($Return + 0xff00); :set Multi ($Multi / 0x100); } else={ + :if ($Value = "zero") do={ } :if ($Value = "alpha") do={ :set Return ($Return + 0x3f00); } :if ($Value = "beta") do={ :set Return ($Return + 0x5f00); } :if ($Value = "rc") do={ :set Return ($Return + 0x7f00); } |