Title: Ask Reuben 76 - GOTO Post by: Reuben B. on June 17, 2021, 04:46:28 am If you are like me, then you have probably learnt from an early age that the use of the GOTO statement should be discouraged. I certainly discovered that on my own in my early days on a ZX-81 that using GOSUB was preferable to using GOTO. Then I get to university and discover that others have discovered that long before me.
You might not have realised it, but before we introduced TRY/CATCH, you could have implemented the equivalent using GOTO and LABEL. Whilst I don't think you should allow unlimited use of GOTO, it does have its place in a controlled manner. One such place is in a MENU statement to trigger an action as you enter the MENU and save the user selecting it themselves. To read more about GOTO, goto https://4js.com/ask-reuben/ig-76/ |