PDA

View Full Version : How do I use a string stored in a 8 byte array to...



deno
07-25-2005, 03:45 AM
to make a comparison.· Suppose I have the string FORWARD_· already stored·in a 8 byte array called keyboard_data.· Now I want to retreive that whole string to make a comparison:

IF (8 byte array...keyboard_data) =·"forward_" then
· GOSUB robo_forward
ENDIF

I have the string in the array in eeprom, but I can't figure out how to get it out in one piece to make the above comparison.

I am trying to use the ezKEYER from Multilabs to control "robo child".

Deno

Yanroy
07-26-2005, 12:05 AM
As far as I know, there isn't any way to do it all at once.· You have to check each byte individually.· Here's some pseudocode which assumes you have two arrays that you want to compare between (I know this isn't exactly your situation, but I assume you can figure out how to replace the second array with reading the appropriate character from eeprom or however you wish to store it).

for n = 0 to 8

if keyboard_data(n) <> comparison_string(n) then goto no_match

next

' if execution reaches here, the strings are the same

no_match:

' if this label is jumped to, the strings aren't the same