Contributed by: Darin McBride
There are actually quite a number of ways to get OS/2 environment variables. Too often, however, I find myself using the value('myvar',,'OS2ENVIRONMENT') method. I don't find that readable. Take the following snippet, save it as 'getenv.cmd', and you have a convenient, and readable, method - much like us old C programmers are used to!
/*
* GetEnv
*
* Parameters:
* OS/2 environment variable to look up.
*/
return value(arg(1),,'OS2ENVIRONMENT')