![]() |
![]() |
#1 |
Registered User
Join Date: Mar 2014
Location: Leeds
Posts: 141
|
how to quit procedure?
Hi there,
I'm on stage of experimenting with procedures. I call procedure from main loop and i have a loop in procedure, so it keeps repeating itself. how do i quit this procedure after a few loops, let's say 5, and then end procedure and go back to main program (loop)? |
![]() |
![]() |
#2 |
Amiga Tomcat
Join Date: Sep 2007
Location: Boston Lincs
Posts: 1,502
|
The easiest way to get a loop is to use FOR whatever condition NEXT
It's available in nearly every BASIC I know of. I haven't used AMOS for a long time but it'll be in there somewhere |
![]() |
![]() |
#3 |
Registered User
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 2,127
|
If you're in a loop, you can use EXIT to get out, and let the procedure finish gracefully. EXIT IF <condition> is handy too.
D. |
![]() |
![]() |
#4 |
Registered User
Join Date: Mar 2015
Location: Sheffield UK
Posts: 360
|
Or to exit disgracefully ......
If COUNT = 5: Pop Proc : Endif should do it (useful if there is something you don't want to do at the end of the procedure. |
![]() |
![]() |
#5 |
Registered User
Join Date: Mar 2014
Location: Leeds
Posts: 141
|
well i tried exit but the procedure is more complicated and there are more loops
![]() ![]() |
![]() |
![]() |
#6 |
Registered User
Join Date: Mar 2015
Location: Sheffield UK
Posts: 360
|
|
![]() |
![]() |
#7 |
In deep Trouble
Join Date: Sep 2004
Location: Manchester, Made in Norway
Age: 51
Posts: 841
|
insert near the end a check for LMB, if LMB then exit routine
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Screen fip procedure | arti | Coders. System | 2 | 28 September 2014 19:40 |
Correct procedure for adding a new WHDLoad game to Gamebase Amiga's database? | jamespstevenson | support.Games | 1 | 30 March 2010 12:30 |
Procedure for Saving WHDLoad | jamespstevenson | support.WinUAE | 8 | 14 April 2009 20:30 |
Installing procedure fails on my real Amiga. | fc.studio | project.ClassicWB | 7 | 20 June 2007 10:38 |
|
|