mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-12 19:14:27 +02:00
global-functions: $ParseKeyValueStore: split key and value...
... into separate variables.
This commit is contained in:
parent
6bee467550
commit
ba39c29648
1 changed files with 3 additions and 2 deletions
|
@ -925,8 +925,9 @@
|
|||
:local Result ({});
|
||||
:foreach KeyValue in=[ :toarray $Source ] do={
|
||||
:if ([ :find $KeyValue "=" ]) do={
|
||||
:set ($Result->[ :pick $KeyValue 0 [ :find $KeyValue "=" ] ]) \
|
||||
[ :pick $KeyValue ([ :find $KeyValue "=" ] + 1) [ :len $KeyValue ] ];
|
||||
:local Key [ :pick $KeyValue 0 [ :find $KeyValue "=" ] ];
|
||||
:local Value [ :pick $KeyValue ([ :find $KeyValue "=" ] + 1) [ :len $KeyValue ] ];
|
||||
:set ($Result->$Key) $Value;
|
||||
} else={
|
||||
:set ($Result->$KeyValue) true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue