A method or a loop in a method can be interrupted by using the exit statement:
exit [<label>] [when <condition>]
// order is a variable of type Fuego.Net.Mail
order as Mail
url as String = ""
for each mail in MailServer(url, false).messages do
if mail.subject = "New Order" then
order = mail
exit
end
end
// if there is no order to process,
// stop method execution exit when
// order is null.
participantName = "John"
for each p in activity.role.participants do
if p.name = participantName then
// participant found!
nextParticipant = p
exit : findParticipant
// findParticipant is the name of the method
end
end
For further information refer to topics: