Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#243 Batch labels with a space at the beginning of the line

0.63
closed
shell (25)
5
2012-09-07
2005-09-28
Cyber M. Taco
No

In DosBox, a label in a batch file who's line starts with a
space doesn't work. Hard to explain, easy to show.

Simple example:

@ECHO OFF
IF EXIST CONFIG.CFG GOTO :RUN
SETUP
:RUN
GAME

(The base idea being if a game's config file doesn't
exist, it should run the setup program first, then the
game.)

Notice that the label lines (":RUN" and ":SETUP")
start with a space.

In real dos, this works fine (and looks nicer too, making
it easier to edit & debug complex batch files). In
DoxBox, I would get a "Label RUN not found".

Yes, removing the spaces makes the batch file work in
DosBox, but seeing as how I have about 15 years worth
of batch files written this way (I go way back - I learned
this trick from PC Magazine in the 286/386 days), this
is a bit of a problem. :-)

Discussion

  • Peter Veenstra
    Peter Veenstra
    2005-09-28

    Logged In: YES
    user_id=535630

    Fixed it.

    The things the people did in the old days :)......

     
  • Cyber M. Taco
    Cyber M. Taco
    2005-09-30

    Logged In: YES
    user_id=957701

    Ain't it the truth. :-D