
-----------------------------------
Vorpike
Fri Dec 21, 2012 7:02 pm

How to return?
-----------------------------------
So I'm trying to make a game menu, from there, you can click a button for instructions, but I need a button to bring me back to the main menu. I tried making a procedure for the menu, and when the the back button is pressed, I run the menu, but this procedure-ception clearly doesn't work. A friend also told me to use a return syntax, which brings me out of the if and back to the menu. But return is basically exit and that didn't work either. So somebody please tell me, how do I make a suitable back button? Sorry, I deleted my code as soon as I saw it didn't work.

Code is attached

-----------------------------------
Insectoid
Sat Dec 22, 2012 10:46 pm

RE:How to return?
-----------------------------------
A procedure ends when it reaches the end of the code in the procedure. If you're running a loop, just quit the loop and skip to the end. If necessary, use if statements to skip past extra code. 

Also, 'return' is a perfectly valid way to quit the procedure. It is not the same as 'exit'. 'exit' is used to quit loops where 'return' quits procedures.

-----------------------------------
simpletrick
Mon Dec 31, 2012 4:42 pm

Re: How to return?
-----------------------------------
I would use procedures that will "loop" back to main menu. 
Procedure game/option/help/whatever, and procedure menu. 
and "loop" it back to menu

-----------------------------------
Insectoid
Mon Dec 31, 2012 6:06 pm

RE:How to return?
-----------------------------------
That makes no sense.
