Community discussions

MikroTik App
 
jeroenp
Member Candidate
Member Candidate
Topic Author
Posts: 159
Joined: Mon Mar 17, 2014 11:30 am
Location: Amsterdam
Contact:

[Answered] Shortcut "goto" like constructs possible?

Thu Oct 13, 2016 10:15 pm

Are any of the below "goto" like constructs possible? If so, how?

- function/procedure exit
- loop break
- loop continue

--jeroen
Last edited by jeroenp on Fri Oct 14, 2016 1:23 pm, edited 1 time in total.
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2411
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Shortcut "goto" like constructs possible?

Thu Oct 13, 2016 10:39 pm

- function/procedure exit
there's the :return command, which does just that.
- loop break
The closest thing I can think of is using :error to intentionally stop everything within a ":do", and handle it further in "on-error", but then again, that's more like try...catch.
- loop continue
AFAIK, nope.
PEAR2_Net_RouterOS(1.0.0b6) - My API client in PHP
(Rate my posts? If you want... no pressure...)
 
jeroenp
Member Candidate
Member Candidate
Topic Author
Posts: 159
Joined: Mon Mar 17, 2014 11:30 am
Location: Amsterdam
Contact:

Re: [Answered] Shortcut "goto" like constructs possible?

Fri Oct 14, 2016 1:25 pm

Thanks for confirming my suspicion of `:return` being the only such construct.

--jeroen

Who is online

Users browsing this forum: No registered users and 20 guests