Mail Archives: djgpp/2004/01/29/02:46:54
> From: "Nathan Kreiger" <nathankreiger AT hotmail DOT com>
> Newsgroups: comp.os.msdos.djgpp
> Date: Wed, 28 Jan 2004 08:06:18 -0800
>
> I ran PROG1 and set the variable to "One, two, three, test.",
> but when PROG2 trys to read the variable, it's already gone.
> (Garbage collection at work?)
This happens because the environment variables set by PROG1 are gone
when PROG1 exits (they live in a block of memory that is allocated
for PROG1 and deallocated when PROG1 exits).
> Is there a way to set environmental variables so that they stay put
> even when the program that set them terminates?
The only portable way to do it is with a batch file.
- Raw text -