home bbs files messages ]

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

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

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

   Message 40,787 of 42,547   
   Gary Segal to foxidrive   
   Re: IF > 0   
   13 Nov 13 08:00:08   
   
   From: segalgary@gmail.com   
      
   On Wednesday, November 13, 2013 10:43:18 AM UTC-5, foxidrive wrote:   
   > On 14/11/2013 02:32, Gary Segal wrote:   
   >   
   > > Hi Guys   
   >   
   > > Does anyone knows what is the proper syntax for IF?   
   >   
   > >   
   >   
   > > here is my logic:   
   >   
   > > Set /a WIL# = 000001   
   >   
   >   
   >   
   > That creates a variable called "%wil# %" and set it to " 00001" without the   
   quotes.   
   >   
   >   
   >   
   > > ECHO %WIL#%   
   >   
   > >   
   >   
   > > the logic below will work either way if WIL# > 0 or = 0   
   >   
   >   
   >   
   > The logic below isn't using WIL#   
   >   
   >   
   >   
   > > IF NOT CHA# == 0 (Do something)   
   >   
   > >   
   >   
   > > what is the correct syntax?   
   >   
   > > I need it work like this - IF CHA# > 0 (Do something)   
   >   
   >   
   >   
   > if %cha#% GTR 0 echo make my day   
      
   Thank you FoxiDrive   
      
   I tried that, did not work.   
   Here is my full logic   
   PushD "Y:"   
   CD "Cloud"   
   set "dir1=Y:\Cloud"   
      
   Set /a WIL# = 000000   
   ::: This is a Counter for Load/Email Logic ::   
   for %%X in ("%dir1%\*WIL*.edi") do (Set /a WIL# = WIL#+1)   
      
   :: Load Willa   
      
   IF NOT WIL# == 0 (   
   MkDir  "Works fine"   
   RoboCopy "Works fine"   
   :Email   
   SendEmail "Works fine")   
      
   The problem is that this logic is always executed. I need it to work only when   
   WIL# > 0   
   Thanks   
      
   --- 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