English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. AMOS

 
 
Thread Tools
Old 17 March 2016, 17:37   #1
aszu
Registered User

aszu's Avatar
 
Join Date: Mar 2014
Location: Leeds
Posts: 140
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)?
aszu is offline  
Old 17 March 2016, 17:46   #2
davideo
Amiga Tomcat

davideo's Avatar
 
Join Date: Sep 2007
Location: Boston Lincs
Posts: 1,327
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
davideo is offline  
Old 17 March 2016, 18:09   #3
Dunny
Registered User

Dunny's Avatar
 
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 1,461
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.
Dunny is online now  
Old 17 March 2016, 19:46   #4
volvo_0ne
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.
volvo_0ne is offline  
Old 17 March 2016, 19:50   #5
aszu
Registered User

aszu's Avatar
 
Join Date: Mar 2014
Location: Leeds
Posts: 140
well i tried exit but the procedure is more complicated and there are more loops I'll give a try to the volvo_one's one
aszu is offline  
Old 01 April 2016, 21:17   #6
volvo_0ne
Registered User

 
Join Date: Mar 2015
Location: Sheffield UK
Posts: 360
Quote:
Originally Posted by aszu View Post
well i tried exit but the procedure is more complicated and there are more loops I'll give a try to the volvo_one's one
Did it work for you?
volvo_0ne is offline  
Old 08 April 2016, 23:59   #7
Doc Mindie
In deep Trouble
 
Join Date: Sep 2004
Location: Manchester, Made in Norway
Age: 48
Posts: 834
insert near the end a check for LMB, if LMB then exit routine
Doc Mindie is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:31.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.07318 seconds with 13 queries