What you describe in the first paragraph quoted here is almost hashing. Hashing involves applying a hash function that maps a string to a (usually) unique number. That number is then truncated in some manner to be the index into your hash table. In your case this would be the table of commands. As Wouter already mentioned you then do a char by char check on the hash table entry that you find (assuming one was found) to double check that the command is indeed a proper match. On a PC a hash table gives you very fast access to data with a trade off in memory. Perhaps a hash table with linear probing would work well for your application (Google should be able to return lots of computer science course notes with info on how that works). It would be a lot more work over basic string comparisons though. Wesley On Wed, Aug 13, 2003 at 07:21:10AM +0100, Trevor Page wrote: > 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. -- Wesley Moore http://wmoore.freeshell.org/ RMIT - BEng (Comp Sys Eng)/BApp.Sc. (Comp Sci) 5th (And Final!) Year SDF Public Access UNIX System http://sdf.lonestar.org/ -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body