Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: AngelFish on January 05, 2011, 04:53:48 pm

Title: Lookup table
Post by: AngelFish on January 05, 2011, 04:53:48 pm
I'm trying to get a lookup table to work, but something odd keeps happening. What I'm trying to do is accept some key input and find the location of the key code within the array. Here's some example code:

Code: [Select]
[0123456789ABCDEF36]->Str1
...
getkey->K
For(A,0,8
If K=e{Str1+A}
Goto BRK
End
End
Lbl BRK

where the e is scientific notation E.

This should store the array offset in A, but it doesn't seem to be working. For example, if you were to press 2nd (keycode=54), then it would return 8 in A.
Title: Re: Lookup table
Post by: calc84maniac on January 05, 2011, 04:59:17 pm
You should try using inData() :D

Code: [Select]
[0123456789ABCDEF3600]->Str1
...
getKey->K
If K
If inData(K,Str1)->A
Goto BRK
End
End
...
Lbl BRK
Title: Re: Lookup table
Post by: AngelFish on January 05, 2011, 05:01:32 pm
/me didn't even know that was a command  :P

Thanks.
Title: Re: Lookup table
Post by: aeTIos on February 12, 2011, 11:19:18 am
:O inData is a command similar to inString, i think?
Title: Re: Lookup table
Post by: squidgetx on February 12, 2011, 11:21:20 am
Yup. Actually, the token for inData() is inString() lol
Title: Re: Lookup table
Post by: aeTIos on February 12, 2011, 11:22:26 am
i thought so :P
Title: Re: Lookup table
Post by: Deep Toaster on February 12, 2011, 11:48:17 am
Except that inData is exactly the opposite (in syntax) from inString. inString is inString(STRING_TO_SEARCH_IN,STRING_TO_FIND) while inData is inData(BYTE_TO_FIND,STRING_TO_SEARCH_IN).