(Sent with the tag this time. Bah) Hi list, My current project contains a simple RS232 interface and is to recognise typed commands received from a host PC. These commands will be simple, short text strings e.g. GAIN, INPUT1 etc. So essentially the problem is that I need to take a short text string and see if it matches any of 30 (or so) text strings contained within program memory (stored using rom const char[]="blah"; etc), and return an index number of the matched string if there is a positive match. The first - and most obvious - method I can think of by which to compare a given string of characters with a set of tabulated strings is to just start at the top of the table, compare the first characters, if no match then move down to next string in table, compare first characters again, if match then compare the next characters along, etc etc. But this is a wheel that has already been invented over and over again no doubt, and I was wondering if there is a more clever or established method that someone could suggest I use. I know one other way could be to take the checksum of the input string and compare that with checksums of the strings in ROM which is a much faster process, but this would result in other randomly typed character combinations potentially causing a 'match' too, unless there is a more clever way of doing it. Or there is the hash process which I am vaguely familiar with, but I don't know if this is what I need. Code examples for possible solutions would be useful (C or ASM) but a basic suggestion about what kind of method to use would be extremely helpful too. Thanks in advance, Trevor. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body