View Single Post
Old 17 February 2021, 15:52   #7
Havie
Registered User
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,199
Quote:
Originally Posted by Daedalus View Post
There's nothing wrong with a Gosub (or even a Goto, for that matter) if it's used responsibly and with good reason They're a bit old skool and can lead to difficult to debug situations, weird bugs and tricky to follow code, but they're also faster than using functions, and in game terms on stock hardware, that speed difference can be important.

Make sure every Gosub is terminated with a Return, and that if you leave the Gosub for anything, you Return back into it before Returning to the previous point. If you really need to, you can Pop out of a Gosub stack, but I think such a situation could easily be handled some other way.
Thanks - will track them all through...
Havie is offline  
 
Page generated in 0.04653 seconds with 11 queries