Re: TIB: Number from list
[Prev][Next][Index][Thread]
Re: TIB: Number from list
Ah, yes... on the TI-89, it is more similar to a 92/+.
Lists are handled like this:
{0,9,8,7,6,5,4,3,2,1}->lst
{0,9,8,7,6,5,4,3,2,1}
lst[1]
0
lst[2]
9
lst[3]
8
lst[4]
7
...
Strings are similar to how you described them, only the 89 uses the 'mid('
command much like Quick BASIC.
"0987654321"->str
"0987654321"
mid(str,1,1)
"0"
mid(str,2,1)
"9"
mid(str,3,1)
"8"
...
But if you want the values, you'll have to use the 'expr(' command to get
the actual values instead of a string.
"0987654321"->str
"0987654321"
expr(mid(str,1,1))
0
expr(mid(str,2,1))
9
expr(mid(str,3,1))
8
...
-Miles Raymond EML: m_rayman@bigfoot.com
ICQ: 13217756 IRC: Killer2 AIM: MRayMan
http://www.bigfoot.com/~m_rayman/
----- Original Message -----
From: <Bigskank9@aol.com>
To: <ti-basic@lists.ticalc.org>
Sent: Monday, April 12, 1999 8:22 PM
Subject: Re: TIB: Number from list
> In a message dated 4/12/99 5:19:31 PM Pacific Daylight Time,
Jared173@aol.com
> writes:
>
> <<
> Say I had a list like {5, 2, 6, 4}
> What would be the fastest way to get the third number in the list?
>
> Ooh, apparently a string takes up less memory on the 89. So, how would I
do
> the same sort of thing for a string, like finding the third number from
the
> left, etc. ?
> >>
>
> \->\=sto command
> on the 86 if you do {5,2,6,4}\->\A
> then A(1)=5 A(2)=2 A(3)=6 A(4)=4
> the syntax may be a little diffrent for the 89
> and you can use the "sub" command to deal w/ strings
> ex: "5264"\->\A
> sub(A,3,1)=6
> the 3 points to the first space to start at and 1=the length which would
> return 6
> once again the 89 may have diffrent syntax
References: