mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-05-31 15:52:37 +00:00
global-functions: $CleanName: use :continue in loop
This commit is contained in:
parent
439774820f
commit
c14ed7ca0d
1 changed files with 4 additions and 10 deletions
|
|
@ -306,17 +306,11 @@
|
|||
:for I from=0 to=([ :len $Input ] - 1) do={
|
||||
:local Char [ :pick $Input $I ];
|
||||
:if ([ :typeof [ :find "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" $Char ] ] = "nil") do={
|
||||
:do {
|
||||
:if ([ :len $Return ] = 0) do={
|
||||
:error true;
|
||||
}
|
||||
:if ([ :pick $Return ([ :len $Return ] - 1) ] = "-") do={
|
||||
:error true;
|
||||
}
|
||||
:set Char "-";
|
||||
} on-error={
|
||||
:set Char "";
|
||||
:if ([ :len $Return ] = 0 || \
|
||||
[ :pick $Return ([ :len $Return ] - 1) ] = "-") do={
|
||||
:continue;
|
||||
}
|
||||
:set Char "-";
|
||||
}
|
||||
:set Return ($Return . $Char);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue