Re: TIB: Goto's


[Prev][Next][Index][Thread]

Re: TIB: Goto's






On Mon, 9 Feb 1998, Arno Kizina wrote:

> 
> Grant Stockly schrieb:
> >
> > This is what I do for my sub programs.  I make a list of all the
> > subroutines I need to do and then this:
> 
> On A Goto would be nice, wouldn't ot?		A.K.

On the TI-92, you can do this:

:Prgm test(a)
:goto #("a" & string(a))
:
:Lbl a1:
:disp "You entered 1"
:Return
:
:Lbl a2:
:disp "You entered 2"
:Return
:
:Lbl a3:
:disp "You entered 3"
:Return
:
:EndPrgm

This example creates a string "a" + the parameter. It then changes the 
string to a label before using it in the goto command.

In the example, the parameter must be 1, 2, or 3, or an error is
generated.

JG

> >
> > :"Looks for which routine to run
> > :If A=1:Then:Goto 1:End
> > :If A=2:Then:Goto 2:End
> > :If A=3:Then:Goto 3:End
> > :If A=4:Then:Goto 4:End
> > :"Return if you made a mistake
> > :Return
> > :
> > :Lbl 1:5->B:Return
> > :Lbl 2:5->C:Return
> > :Lbl 3:5->D:Return
> > :Lbl 4:5->E:Return
> >
> > This is a real bad example, but it is what I do...
> >
> >
> 
> 


References: