wifinigel.MikrotikScripting/scripts/v6/ch8-07-while-with-exit.rsc
2023-05-29 07:47:33 +01:00

17 lines
No EOL
370 B
Text

# filename: ch8-07-while-with-exit.rsc
# Let's create a loop using "while"
:local LoopCounter 5;
:while ($LoopCounter <= 10) do={
# print out the current loop counter value
:put "Value of loop counter is: $LoopCounter";
# increment the counter
:set LoopCounter ($LoopCounter + 1);
}
# print a message when/if the loop exits
:put "Loop has exited!";