mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-22 11:54:44 +02:00
global-functions: $EitherOr: revert...
... but leave a comment.
This commit is contained in:
parent
8ea7805541
commit
511184a4a7
1 changed files with 1 additions and 3 deletions
|
@ -382,15 +382,13 @@
|
|||
:set EitherOr do={
|
||||
:global IfThenElse;
|
||||
|
||||
:if ([ :typeof $1 ] = "bool") do={
|
||||
:return $1;
|
||||
}
|
||||
:if ([ :typeof $1 ] = "num") do={
|
||||
:return [ $IfThenElse ($1 != 0) $1 $2 ];
|
||||
}
|
||||
:if ([ :typeof $1 ] = "time") do={
|
||||
:return [ $IfThenElse ($1 > 0s) $1 $2 ];
|
||||
}
|
||||
# this works for boolean values, literal ones with parentheses
|
||||
:return [ $IfThenElse ([ :len [ :tostr $1 ] ] > 0) $1 $2 ];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue