Gosub or functions?

Blitz3D Forums/Blitz3D Beginners Area/Gosub or functions?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

The key here is variable scope. You should preferably use functions, because that way any larger or more complicated subroutines use their own 'local' variables, which means they have *no* chance of screwing up you 'main' variables. Ofcourse if you're not carefull you can still screw up Globals, arrays and types, but generally using functions is safer, particularilly if you're writting a long and/or complex subroutine.

I haven't used goto/gosub for at least a decade. It really holds no advantages over functions/methods. Speed difference is negliable, and certainly not worth the possible stabilty trade-off.