Windows XP Home/Pro IF command advice.

September 17, 2010 at 19:42:28
Specs: Windows XP, Intel P4 1.6/2Gb
I'm a newbie and trying to understand the If command character (string?) comparison. In the following command line when the date is set to 23/09/2010 the command line returns True, if the date is set to Sat 23/09/2010 the return is False but I can't work out what is being compared to give/change the result. How can 23/09/2010A be less than A? Can someone lead me through the comparison please.

if "%date%A" lss "A" (echo Result is True.) else (echo Result is False.)


See More: Windows XP Home/Pro IF command advice.

Report •


#1
September 18, 2010 at 06:22:13
How can 23/09/2010A be less than A?
Value of "A" = 65
Value of "2" = 50
65 > 50.
That's really all there is to it. To get the value of the characters, consult an ASCII table.

Report •

#2
September 18, 2010 at 06:38:47
There's no shortage if variation vis-a-vis version, language etc.

But usually the LSS test on a string is by ASCII order.

2 is 32 hex
A is 41 hex
S is 53 hex


=====================================
Helping others achieve escape felicity

M2


Report •

#3
September 18, 2010 at 06:42:34
Hi R2,

I gotta learn to think faster.


=====================================
Helping others achieve escape felicity

M2


Report •

Related Solutions

#4
September 18, 2010 at 06:50:24
Coffee helps. More than I'll admit. :P

Report •

#5
September 18, 2010 at 11:42:06
OMG, it's so simple.

Thank you.


Report •

Ask Question