Author Topic: Lookup table  (Read 2752 times)

0 Members and 1 Guest are viewing this topic.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Lookup table
« 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.
« Last Edit: January 05, 2011, 04:54:46 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Lookup table
« Reply #1 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
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Lookup table
« Reply #2 on: January 05, 2011, 05:01:32 pm »
* Qwerty.55 didn't even know that was a command  :P

Thanks.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Lookup table
« Reply #3 on: February 12, 2011, 11:19:18 am »
:O inData is a command similar to inString, i think?
I'm not a nerd but I pretend:

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Lookup table
« Reply #4 on: February 12, 2011, 11:21:20 am »
Yup. Actually, the token for inData() is inString() lol

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Lookup table
« Reply #5 on: February 12, 2011, 11:22:26 am »
i thought so :P
I'm not a nerd but I pretend:

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Lookup table
« Reply #6 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).