Discussion Forums at Tactical Neuronics


Re: Re: Re: Re: Re: Re: scratch that - no serious CAICL problems :) From:
Shea Parkes

Oiy, it's been awhile for me, but I still think I can anser all those subclick questions from memory.

There is only a 100 recursion limit on gosub, not goto. And for each return you do, the gosub "cache" is lowered, so as long as you return each time there is no limit.

I believe John was a bit confusing earlier as well. Gosub is in fact slightly faster than goto in some ways. When you use a goto, it takes one subclick for the goto, and one subclick for the label. If you use a gosub, it uses one subclick for the gosub, but it skips the label and the next subclick is the line after the label. Then when you use the return, the return uses one subclick, and the next subclick is the line after the original gosub.

If you are using smart clicks, and you want to shave a subclick off of a seldom used routine, you can jut replace a goto with a gosub, and then just not bother with the return. It's a pretty common trick. Just make sure it's not a common routine, because if you run over the 100 gosub cache all gosubs and gotos cease to function and your bug will just start rinning straight down it's code.

I hope that helps out,

Later,

Shea

This message is a Reply to: Re: Re: Re: Re: Re: scratch that - no serious CAICL problems :) from John Reder

Replies to this message:


© 2001, John A. Reder.