Computer Science Canada Exit statments |
Author: | Scott [ Sun Feb 01, 2009 3:28 pm ] | ||
Post subject: | Exit statments | ||
Background - Hi so I'm new to the forum but I followed most of the oot tutorials on classes in the tutorial forum and now I'm making a text RPG. I have mostly based it off of the classes III tutorial but I rewrote the entire code so I could learn it well. Question - I want to make my program efficient in doing what it needs(don't we all). I want to have the program exit this entire procedure once it does what I need, If you can point me to a tutorial on exits or just plain out write me a small one for this case it would be helpful. I would like to know most if those exits in the if statement will make it leave the following for i loops.
I cut much of the code out that was unneeded so if you see a reason the program wont work ignore it I just need that exit statement question answered please. Thanks to anyone who helps. |
Author: | andrew. [ Sun Feb 01, 2009 8:13 pm ] |
Post subject: | RE:Exit statments |
When it does that first if statement, it will exit. Put something like exit when blah = blah to make it exit when a certain condition is met. |
Author: | DanielG [ Mon Feb 02, 2009 11:32 am ] |
Post subject: | RE:Exit statments |
since this is a proc, you can also use return, but exit when is probably better (unless you want to exit in the middle of a nested loop). |