From: zfysz@nospicedham.fysnet.net   
      
   "wolfgang kern" wrote in message   
   news:oiu61s$39l$1@gioia.aioe.org...   
      
   >>> If your strings contain also numbers then a OR 0x20 would work while AND   
   >>> 0xDF wont.   
   >   
   >> Why not? If guarenteed to only have alpha and numeric chars, an   
   >> AND will work also. Numeric chars have bit 6 cleared, while alpha   
   >> chars have bit 6 set.   
   >   
   > ??? don't we talk about bit 5 here (Ucase vs. Lcase) ?   
   > If you clear bit 5 on a number ie: 0x30 it becomes a 0x20 aka Space.   
      
   This was with the assumption that there would be only alpha and   
   numeric characters (and the dot).   
      
   > and what would a dot (0x2e) become if you clear bit5 ? [==0x0e]   
      
   0x2E becomes 0x0E, as you state, which is 00001110b. None of   
   the alpha or numeric chars match this when bit 5 is clear.   
      
   >> zero = clear = not equal   
   >> zero = set = strings are equal   
   >> carry = set = string0 < string1   
   >> carry = clear = string0 > string1   
   >   
   >> This all can be created with a single 'sub' instruction.   
   >   
   > exact.   
      
   I have decided to change the requirements from -1, 0, +1, as   
   C would have it, to the above. As long as I document it well,   
   future projects using this code should be just fine.   
      
   Thanks,   
   Ben   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|