Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Frank M

macrumors member
Original poster
Aug 20, 2019
68
4
New Jersey
1-5-20

Is there a way to exit from a “Repeat ... n times” action other than an Exit Shortcut
action?
In certain cases I want to continue processing after exiting the Repeat action BEFORE the 5 times count is reached (see below).

Code:

Repeat 5 times
Ask for account number
Count items in account number
If Count is 0
Show Alert ... Acct number not entered
Otherwise
...
...
“Exit” Repeat Action/Continue
End If
End Repeat
...
Continue processing

Thanks for any help that you can provide.

Frank M
 

NoBoMac

Moderator
Staff member
Jul 1, 2014
6,289
4,988
Don't think so. But, can use a variable to flag you're done.

Repeat
if variable is not done
do stuff
set variable to done value
end if
 

Frank M

macrumors member
Original poster
Aug 20, 2019
68
4
New Jersey
Don't think so. But, can use a variable to flag you're done.

Repeat
if variable is not done
do stuff
set variable to done value
end if
1-6-20

After my post I did exactly what you had suggested and it worked.
The only thing is that the code has to execute until the Repeat 5 times had been reached.
But it did what I wanted it to do, so I guess it is a good “work-around”.
Thanks for your quick response.
Frank M
[automerge]1578317152[/automerge]
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.