Thank you guys.
Robert
Thank you guys.
Robert
"No one is completely worthless. They can always serve as a bad example."
Anonymous
If you want to be a cowboy for some reason you could have used GOTO instead of GOSUB.
Then you could GOTO back as well (instead of RETURN).
The difference between GOTO and GOSUB is that GOSUB loads the stack with the location it was called from so that a RETURN can go back there, but GOTO doesn’t need to do that.
BUT! using a GOTO to go somewhere, and another GOTO to go back, just means that neither GOTO had to exist, and you could have just dropped the routine right in where the GOTO was.
Also, using GOSUB reduces code size as this Sub can be called from various points of the program to do the same job, maybe with some parameters passing to it.
Keeps things structured.
Ioannis
Bookmarks