help with spacing in a batch file with a for loop

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to write a batch file, but I want to make it as readable as
possible for future edits. I have a lot of if statements in a for loop and
it only works if I put it on one line. Otherwise I get the error "0 was
unexpected at this time" during a simple == comparison. What are the spacing
rules for batch files? Can you not space it such as:
if %_yestermonth% equ 2 (
set /a _yesterday=%_yesterday% + 1
)

?

Thanks ahead of time for any help on the subject.
 
cwtrex said:
I'm trying to write a batch file, but I want to make it as readable as
possible for future edits. I have a lot of if statements in a for loop and
it only works if I put it on one line. Otherwise I get the error "0 was
unexpected at this time" during a simple == comparison. What are the spacing
rules for batch files? Can you not space it such as:

As far as I remember, leading spaces are not allowed, but comments.
Begin the comment line with
::
and add some info about what is happening at this point of the file.
 
Back
Top