two if statements - batch

December 16, 2009 at 04:34:41
Specs: win xp 5.1.2600, 3mhz/2 gig
Hi, the following doesn't work. (ALL ONE LINE)

if %span% geq 68 if %span% leq 14 goto :SPANERROR

Any ideas why? I thought it was possible to have two 'IF' statements on one line.

Thank you for your suggestions.

See More: two if statements - batch

Report •

December 16, 2009 at 05:18:21
You can have multi IFs. Your logic is flawed.

This works:

set span=22
if %span% leq 68 if %span% geq 14 echo y

This doesn't:

set span=22
if %span% geq 68 if %span% leq 14 echo y

There's no number that's north of 67 & south of 15. LOL

Helping others achieve escape felicity


Report •

December 16, 2009 at 05:28:26
Sorry about that, I had some time to think and my example isnt clear at all.
I see now that I am going about it the wrong way. I will use your method. It just makes sense!

Thanks M2

Report •

Related Solutions

Ask Question