home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 67,275 of 68,980   
   Petr Laznovsky to All   
   Re: IF numerical comparsion   
   13 Aug 18 12:33:01   
   
   From: nobody@nowhere.com   
      
   Dne 13.8.2018 v 11:17 Herbert Kleebauer napsal(a):   
   > On 13.08.2018 10:59, Petr Laznovsky wrote:   
   >> Following batch print DEVTYPE0 and DEVTYPE2 as its output, but expected if   
   DEVTYPE0 and DEVTYPE1. Am   
   >> I miss something? I am on w2k3.   
   >>   
   >> L.   
   >>   
   >>   
   >> @echo off   
   >> set "devtype=2"   
   >>   
   >> if not "%devtype%"=="" (   
   >>         if devtype GEQ 1 (   
   >   
   >           if %devtype% GEQ 1 (   
   >   
   >>               echo DEVTYPE0 "%devtype%"   
   >>               if devtype LSS 20 (   
   >   
   >                 if %devtype% LSS 20 (   
   >   
   >>                     echo DEVTYPE1 "%devtype%"   
   >>                     ) else (   
   >>                     echo DEVTYPE2 "%devtype%"   
   >>                     )   
   >>               )   
   >>         )   
   >>   
   >   
      
   There is a word 'string' in the "IF /?" instead of word 'variable', this wat   
   whas confuse me. I   
   expect if string is a defined variable, than auto-evaluate in IF clause, which   
   is not true :-/   
      
   thanks L.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca