[TIB] Re: Character Substitution?


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

[TIB] Re: Character Substitution?




On Thu, 3 May 2001, ffolkes wrote:

> 
> "Missing (" and it points to the line "Goto End"

The variable String needs to be changed to something else because
String is also the name of a function. 
Also,
The first line needs to be changed to 
""->Whatever you changed the String variable to

> 
> Thanks for your help! Also, how would I go about "expanding" it for 
> encompass more letters? Thanks again!

If you wanted to add

s = d

you would add 
"s"->mat[3,1]
"d"->mat[3,2]

For each set of letters you add you have to increment the number where 
3 is by one
 
> 
> TM
> 
> At 08:38 PM 5/3/2001 -0500, you wrote:
> 
> >On Thu, 3 May 2001, ffolkes wrote:
> >
> > >
> > > Hello-
> > >
> > > I'd like to make a program to substitute characters from a string, i.e.:
> > >
> > > g = t
> > > o = r
> > > a = b
> > > t = v
> > > s = n
> > >
> > > String: "goats"
> > > Output of Program: "trbvn"
> > >
> > > *Roughly*, how would I go about this? I am familiar to an extent with
> > > TI-BASIC. Thanks.
> > >
> > > TM
> > >
> > >
> > >
> >
> >Hi,
> >
> >here's a program for a ti-92 to do that
> >Just enter the string and hit esc
> >
> >
> >
> >""->fstring
> >newMat(26,2)->mat
> >"g"->mat[1,1]
> >"t"->mat[1,2]   g = t
> >"o"->mat[2,1]
> >"r"->mat[2,2]   o = r
> >...
> >Lbl begin
> >While k=0
> >getKey()->k
> >EndWhile
> >If k = 264      Esc was hit
> >Disp String
> >Goto end
> >EndIf
> >char(k)->c      Turn Value from getkey to a character
> >0->k
> >0->done
> >0->i
> >While done=0            Search matrix till it finds the correct character
> >If c=mat[i,1] Then
> >String&mat[i,2]->String
> >1->done
> >EndIf
> >i+1->i
> >EndWhile
> >Goto begin
> >Lbl end
> 
> 
> 




References: