Marked as: Easy
Hello,
If you'd like to write some rexx script that you want others to use than you may need to determine where to install your script (by default or suggest user) but also so gather info to make the script work properly.
There are a number of varibles set in config.sys that can help you out, e.g. the temp folder and default installation path for programs. The user may set them during system installation or change them later on to something else so you should therefore never hard code them into your scripts.
If you look in config.sys you'll notice a number of lines that begin with the word SET followed by another word and an equal sign. The word between SET and = is the variable that hold the text/value after the equal sign and that's the name you should use to retrieve the information and possibly change/manipulate.
Note that you can't find some of these params in OS/2 as they've been introduced in eComStation. You may have to dig a bit deeper to find out the same info. if you want to support Warp 3 and 4.
You can also temporarily set params that will be vaild for the session/script that run to use e.g. more resources, allow paths to be searched for dlls etc. (modify PATH).
/* Useful info about system */
say 'Operating System: 'value( 'OS',, 'ENVIRONMENT' )
say 'Operating System installation directory: 'value( 'OSDIR',, 'ENVIRONMENT' )
say 'Host name: 'value( 'HOSTNAME',, 'ENVIRONMENT' )
say 'Time Zone: 'value( 'TZ',, 'ENVIRONMENT' )
say 'Country & Language: 'value( 'LANG',, 'ENVIRONMENT' )
temp = value( 'TEMP',, 'ENVIRONMENT' )
if length( strip( temp ) ) = 0 then
temp = value( 'TMP',, 'ENVIRONMENT' )
say 'Temp directory: 'temp
say 'Install programs to 'value( 'PROGRAMS',, 'ENVIRONMENT' )
say 'Place settings for applications in: 'value( 'HOME',, 'ENVIRONMENT' )