mirror of
https://github.com/wifinigel/MikrotikScripting.git
synced 2025-08-02 09:14:51 +02:00
initial commit
This commit is contained in:
commit
c782dde326
61 changed files with 1457 additions and 0 deletions
20
scripts/ch6-09-local-vars2.rsc
Normal file
20
scripts/ch6-09-local-vars2.rsc
Normal file
|
@ -0,0 +1,20 @@
|
|||
# filename: ch6-09-local-vars2.rsc
|
||||
|
||||
# Create a local variable that is an array of words
|
||||
:local Words { "Hello, "; "how "; "are "; "you ?"};
|
||||
|
||||
# Create a local variable to store concatenated words in a string
|
||||
:local WordString;
|
||||
|
||||
# Step through each word and add to the "WordString" variable
|
||||
:foreach Word in=$Words do={
|
||||
:put "Word from array: $Word";
|
||||
:set WordString ($WordString . $Word);
|
||||
}
|
||||
|
||||
# Print out the result
|
||||
:put "\n";
|
||||
:put "New string we've built:";
|
||||
:put $WordString;
|
||||
:put "\n";
|
||||
:put ("Original array: " . [:tostr $Words]);
|
Loading…
Add table
Add a link
Reference in a new issue