mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-06-01 16:22:38 +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={
|
:for I from=0 to=([ :len $Input ] - 1) do={
|
||||||
:local Char [ :pick $Input $I ];
|
:local Char [ :pick $Input $I ];
|
||||||
:if ([ :typeof [ :find "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" $Char ] ] = "nil") do={
|
:if ([ :typeof [ :find "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" $Char ] ] = "nil") do={
|
||||||
:do {
|
:if ([ :len $Return ] = 0 || \
|
||||||
:if ([ :len $Return ] = 0) do={
|
[ :pick $Return ([ :len $Return ] - 1) ] = "-") do={
|
||||||
:error true;
|
:continue;
|
||||||
}
|
|
||||||
:if ([ :pick $Return ([ :len $Return ] - 1) ] = "-") do={
|
|
||||||
:error true;
|
|
||||||
}
|
|
||||||
:set Char "-";
|
|
||||||
} on-error={
|
|
||||||
:set Char "";
|
|
||||||
}
|
}
|
||||||
|
:set Char "-";
|
||||||
}
|
}
|
||||||
:set Return ($Return . $Char);
|
:set Return ($Return . $Char);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue