wifinigel.MikrotikScripting/scripts/ch6-06-local-scope.rsc
2023-01-19 21:27:15 +00:00

33 lines
No EOL
804 B
Text

# filename: ch6-06-local-scope.rsc
# ---- start of a local scope ----
{
:local apple "green";
:local banana "yellow";
:put ("(1) The apple is: $apple");
:put ("(1) The banana is: $banana");
# ---- start of child local scope ----
{
:local apple "red";
:put ("(2) The apple is: $apple");
:put ("(2) The banana is: $banana");
}
# ---- end of child local scope ----
:put ("(3) The apple is: $apple");
:put ("(3) The banana is: $banana");
}
# ---- end of local scope ----
:put ("(4) The apple is: $apple");
:put ("(4) The banana is: $banana");
# ---- start of new local scope ----
{
:local apple "yellow";
:put ("(5) The apple is: $apple");
:put ("(5) The banana is: $banana");
}
# ---- end of new local scope ----