Originally posted by deep
View Post
I once needed to pass a "parameter value" from PgmA down to some PgmD, but couldn't chance changing interfaces in intermediate PgmB, PgmC and/or whatever else might get stuck in between. After quite a bit of thought, I eventually realized that putenv()--Change or Add Environment Variable and getenv()--Get Value of Environment Variable worked exactly as I needed.
Values could be created and retrieved as needed. They're named values, so uniqueness can be controlled. The putenv/getenv APIs/procs already exist, so it's not even really necessary to create your own; but it's certainly possible to do so if you want to wrap in more robust or specific code.
Comment