|
Answer» Win XP Home. Batch script.
Newbie.
Does the If command COMPARE the ASCII decimal value when comparing strings? If so why does the following return True when the ASCII values would show that the return should be False?
Thanks
Code: [SELECT]echo off cls
if "2" gtr ";" echo 2 is greater than ; The cmd.exe IF TEST does not do a plain ASCII comparison. Numerals come before letters; letters are normalized to lower case. For example 4 has a lower character value than 6, so 49 is LESS than 6.1 when compared as strings; ',' is less than ';', etc. ACCORDING to the byte value of the characters.
|