Re: TIB: Back to TI-BASICs
[Prev][Next][Index][Thread]
Re: TIB: Back to TI-BASICs
>TurboSoft@aol.com wrote:
>[...]
>> making all the code in a single program keeps it neatly in one >place
in your
>> programs list, but it is very slow and takes up much more space
>because you
>> can't call subroutines (other programs which sort of help the main
>program
>> out). Of course, even less space would be taken up if the Basic
>language
>> allowed you to return to the last jump command...
>
>Yes, I miss the gosub command every now and then too. I think they
>omitted it because you can make subprograms instead.
>
>[...]
Yeah, I miss it too. I found a page about someone who tried to work
around that... In short it, involved using the indirection command (#)
on label names. Simply store a string of your return label, and Goto a
subroutine inside the program. The subroutine will have something like
'Goto #s' , where 's' is the name of the string var. It's like passing
another paremeter that tells where to return to the rest of the program.
I do not like using Goto's to get out of a loop or the If..Then
statements. I consider it bad style (if not downright unacceptable) in
the TI-8X calcs, because the calculator has no way of knowing it exited
the loop and instead keeps track of it. It is even worse to try to add
more End statements after the label was used to exit the loop, because
now the program is hopelessly meshed into itself and you no longer know
which 'End' applies to which loop. Fortunately, the TI-92 is more
forgiving of this problem. It always checks to make sure the For
matches with EndFor, While with EndWhile, If..Then with EndIf, Prgm with
EndPrgm, etc.
Tavis
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
Follow-Ups: