why should you use return instead of stop?
Date: 12 Jul 2008 19:54
Number of posts: 8
RSS: New posts
Because they do the same thing when you run the program normally; but, if someone else calls your program from a different program, Return will return to the calling program, and Stop will exit directly to the home screen. Because you don't always know how people will make use of your program, it's better to allow them the choice of exiting after your program finishes or not, and use Return.
I see.. does it still cause memory leaks if you use it before you close your loops?
It clears any memory leaks inside a program from which it returns.
so is it a good alternative to creating good program flow?
I don't see how. I mean, the program is over after you use it, so you can't make use of the cleared-memory-leaks state.
Of course, if you don't want people using your programs as subprograms, use a Stop and screw up their plans >:).
Other things that could happen:
No return - the program runs, then just exits to the home screen
Stop - same as above
Before I knew of Return, I used a Pause the first line after calling a subprogram, like so: