mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-06-02 16:52:36 +00:00
dhcp-to-dns: make ToLower a local function, no global-functions dependency
This commit is contained in:
parent
6b2ec93ee6
commit
418ede0ae4
2 changed files with 16 additions and 20 deletions
|
|
@ -81,7 +81,6 @@
|
|||
:global SendNotification2;
|
||||
:global SymbolByUnicodeName;
|
||||
:global SymbolForNotification;
|
||||
:global ToLower;
|
||||
:global Unix2Dos;
|
||||
:global UrlEncode;
|
||||
:global ValidateSyntax;
|
||||
|
|
@ -303,24 +302,6 @@
|
|||
:return $Path;
|
||||
}
|
||||
|
||||
# convert string to lower case
|
||||
:set ToLower do={
|
||||
:local Input [ :tostr $1 ];
|
||||
:local Upper "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
:local Lower "abcdefghijklmnopqrstuvwxyz";
|
||||
:local Return "";
|
||||
|
||||
:for I from=0 to=([ :len $Input ] - 1) do={
|
||||
:local Char [ :pick $Input $I ];
|
||||
:local Pos [ :find $Upper $Char ];
|
||||
:if ([ :typeof $Pos ] != "nil") do={
|
||||
:set Char [ :pick $Lower $Pos ($Pos + 1) ];
|
||||
}
|
||||
:set Return ($Return . $Char);
|
||||
}
|
||||
:return $Return;
|
||||
}
|
||||
|
||||
# clean name for DNS, file and more
|
||||
:set CleanName do={
|
||||
:local Input [ :tostr $1 ];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue