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,731 of 68,980   
   JJ to Tom Del Rosso   
   Re: leading zero   
   09 Mar 21 13:22:18   
   
   From: jj4public@gmail.com   
      
   On Mon, 8 Mar 2021 14:54:43 -0500, Tom Del Rosso wrote:   
   >   
   > I know that, but it should do the same with   
   >   
   > set /a y=x   
   >   
   > As it says in the set help, "Any non-numeric strings in the expression   
   > are treated as environment variable names whose values are converted to   
   > numbers before using them."   
   >   
   > So the conversion is done incorrectly, producing zero as if the variable   
   > was not denied at all.   
      
   You're right. More like it's the error handling which is not done   
   incorrectly.   
      
   It's probably too late to fix the bug, as administrators/programmers have   
   accustomed to this bug. Cause fixing the bug would cause the zero value not   
   be assigned to the variable by SET/A when there's an error. That would   
   affect existing batch files' program logic.   
      
   --- 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