delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/04/00:30:41

From: firewind <firewind AT metroid DOT dyn DOT ml DOT org>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Newbie Coder Seeks Helful Advice ;)
Date: 2 Oct 1997 23:18:10 GMT
Organization: Netcom
Lines: 35
Message-ID: <611a3i$2v6@dfw-ixnews10.ix.netcom.com>
References: <3433A56C DOT 14F9 AT mailexcite DOT com> <01bccf5b$e0462c00$703163c3 AT mrb-comp> <3434015C DOT 349A AT nortel DOT ca>
NNTP-Posting-Host: elp-tx1-05.ix.netcom.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Ian Chapman <ichapman AT nortel DOT ca> wrote:
> Matthew,
>      the %path% I've not seen that in the dos manual where does
> this %  % use come from I was curious the first time I installed
> djgpp.

Inside a batch file (and ONLY inside a batch file; this does not -ever- work
at the command line) anything beginning with % is interpreted specially. As
you probably know, %1 through %9 are the arguments, %0 is a sort of argv[0].

Another way % can be used is to show an environment variable. For example, if
you have an environment variable:

FOO=xyzzy

then a batch file containing the line:

echo %FOO%

will produce the output 'xyzzy'. What is being done with PATH is, a new
directory is added to the beginning, and the rest of the old path gets
tacked on the end. If, previously, you had:

PATH=C:\DOS;C:\WINDOWS;C:\FOO;C:\BAR;C:\XYZZY

then after the 'PATH=C:\DJGPP;%PATH%' it would look like this:

PATH=C:\DJGPP;C:\DOS;C:\WINDOWS;C:\FOO;C:\BAR;C:\XYZZY

late\fw

-- 
[- 				 firewind	                            -]
[-   email: firewind AT metroid DOT dyn DOT ml DOT org (home), firewind AT aurdev DOT com (work)  -]
[- 	    "You're just jealous because the voices talk to -me-."          -]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019