Knew I was opening a can of worms...
Warrier,
Yep that would do it alright... if... you wanted to return to the line following the gosub.
My initial question was can you break out of a gosub nest... can the gosub be canceled such that a "return" would go nowhere. And from the replys I am getting that you can't.
That being said, if... while nested in a subroutine... the program comes across the original gosub... it does not cancel the original subroutine... rather it increments the stack count by one.
Such as...
Main:
gosub here
goto main
end
Here:
if this goto Main
do that
return
If this is true, the gosubs loop until they violate the stack count and the pic crashes (he purses his lips and makes a pffrrgghh sound). I love sound effects.
:-)
I can write code to get around things alright, but I wanted to just cancel where I was in subroutine and go back to "Main"... not "Return" to the next line following the "gosub".
Ross
Never enough knowledge to be called intelligent but just enough knowledge to be considered dangerous!
I like that! :-)
Bookmarks