This seems silly

Blitz3D Forums/Blitz3D Programming/This seems silly

The reason why Goto and Gosub exist within Blitz, I think, is because the original B.A.S.I.C. (before Blitz BASIC) relied an awful lot on this. Besides, how would you move about in your program? You'd have to keep on typing the same code over again, or calling the same function, and it would generally be very confusing.

BUT...technically speaking, Goto's and Gosub's could easily be replaced by loops, "Include", or function calling. Instead of going back to .start, you could just make a Repeat...Until loop or a While...WEnd loop. But they're very handy for debugging, as said before, to completely skip over a piece of code that you suspect is runining your program.

Another thing--my theory about there not being a GoSub command allowed in a function is the fact that a value can be Returned, and you must use Return at the end of a GoSub, causing a fair amount of confusion for your poor computer which doesn't know which Return means what.

Of course, a quick fix for this is just to create another label at the end of code to return, such as:

Goto label1
.label2

.label1
;do something
Goto label2

This kinda is the same as the GoSub's purpose anyway.

But this is all just too much work, isn't it?