Help on subprocedures
- Hello all,
A relative batch newbie here. I've been scouring the web for hours
now looking to a concise answer to my question, but of course no luck.
I'm writing a relatively simple batch (or so I thought) that is
divided into a few subprocedures. However, I must be fundamentally
misunderstanding how it loops through, because my program keeps
starting over when it is done.
I'm using the tried-and-true methodology of "snipping all of my code
from examples on the web". (^_-)
So, I have 3 questions:
1. Most of the things I have seen include these two lines:
if not exist %0 goto ERROR
if not "%1"=="" goto %1
I just don't "get" these two lines. Could someone explain what that %
2. What is the difference between "calling" a procedure and "goto"?
3. One example I saw looked like this (courtesy Eric Phelps):
call %0 ECHOHI
call %0 ECHOBYE
What I don't get is, it calls ECHOHI, which prints "Hi" then goes to
the DONE procedure. So, how does it get back up to the MAIN procedure
again? How can I just tell the program "you are totally done, quit
Anyway, thanks for your help!