Runtime.SetEnvironmentVariable

Prototypes

static void SetEnvironmentVariable( String sName, String sValue )

Parameters

String sName
The name of the environment variable.

String sValue
The value of the environment variable. If you call this method with sValue equal to null, the specified environment variable is deleted.

Remarks

This method enables an IMLPlus program to manipulate the environment variables of IML Studio's process. In Windows, each operating system process has a private table of environment variables. Each entry in an environment table has the form Name=Value, where both Name and Value are strings. You can use the method SetEnvironmentVariable to create a new environment variable, to change the value of an existing environment variable, or to delete an environment variable.

One use for the method SetEnvironmentVariable is to pass debugging-related information to modules without having to use global variables.

Example
Runtime.SetEnvironmentVariable( "PRINT_DEBUG_MESSAGES", "Y" );
Runtime.SetEnvironmentVariable( "ENABLE_PAUSE_STATEMENTS", "Y" );

if nleng(Runtime.GetEnvironmentVariable( "PRINT_DEBUG_MESSAGES" )) > 0 then
    print "Got here";
if nleng(Runtime.GetEnvironmentVariable( "ENABLE_PAUSE_STATEMENTS" )) > 0 then
    pause "Debugging breakpoint; click Resume to continue";
See Also

Runtime.GetEnvironmentVariable