1.

Solve : What values does the IF command compare??

Answer» <html><body><p>Win XP Home.  Batch script.<br/><br/>Newbie.<br/><br/>Does the If command <a href="https://interviewquestions.tuteehub.com/tag/compare-11929" style="font-weight:bold;" target="_blank" title="Click to know more about COMPARE">COMPARE</a> 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?<br/><br/>Thanks<br/><br/> Code: <a>[<a href="https://interviewquestions.tuteehub.com/tag/select-630282" style="font-weight:bold;" target="_blank" title="Click to know more about SELECT">SELECT</a>]</a>echo off<br/>cls<br/><br/>if "2" gtr ";" echo 2 is greater than ;<br/>The cmd.exe IF <a href="https://interviewquestions.tuteehub.com/tag/test-13460" style="font-weight:bold;" target="_blank" title="Click to know more about TEST">TEST</a> 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 <a href="https://interviewquestions.tuteehub.com/tag/less-536996" style="font-weight:bold;" target="_blank" title="Click to know more about LESS">LESS</a> than 6.1 when compared as strings; ',' is less than ';', etc. <a href="https://interviewquestions.tuteehub.com/tag/according-366619" style="font-weight:bold;" target="_blank" title="Click to know more about ACCORDING">ACCORDING</a> to the byte value of the characters. <br/></p></body></html>


Discussion

No Comment Found