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,726 of 68,980    |
|    JJ to Tom Del Rosso    |
|    Re: leading zero    |
|    08 Mar 21 09:21:03    |
      From: jj4public@gmail.com              On Sun, 7 Mar 2021 09:28:16 -0500, Tom Del Rosso wrote:       >       > But this doesn't explain (it seems to me) why the variable without       > percents has a different result. SET/A is supposed to behave the same       > with or without the percents.              With below command...               set /a y=%x%              The reason why it causes an error is because CMD performs syntax check then       expands any expandable variable references (which uses the percent sign),       THEN it executes the command.              So, if x variable contain 09, the command line would be like below before       it's executed.               set /a y=09              Meaning, the given value is a constant, rather than a variable name, from       the perspective of the SET /A command.              --- 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