GUI ScreenIO for Windows |
This API sets the value of an environmental variable.
Environmental values may be set but the setting will not survive the current job. Each job (program) receives a copy of the environment when it is started, and may manipulate this environment at will, but any such changes will disappear at the end of the job. However, this can be a useful way to set arguments for a sub-process invoked by the winexec API or for setting flags and switches or passing small bits of data to subroutines without the use of arguments in the linkage section.
Be aware that the size of the environment is fixed at job start time, so if you plan to make extensive use of this you must set the environment size before you start your job.
Some compilers have the utilities or APIs to set environmental variable values. However, these utilities are not transportable to another compiler, nor are they client/server aware, meaning you can not return values from the client unless you uses this API.
This API will set the variable in the client. You can optionally set variables in the server if you can preceded the API call with the following Set statement:
SET WIN32API-EXECUTE-API-ON-SERVER TO TRUE |
Files available to copy to your system:
COPY WIN32API.
|
This field must be set to the length of the field which holds the value of the environmental variable. The ENVIRON copybook supplies a generic field of 1024 bytes, but since environmental values can be up to 32k bytes, you may have to substitute a different field for ENV-VARIABLE-VALUE. In any event, this field must be set to the length of your field.
This field should contain the name of the environmental variable you want to set. It is case insensitive.
This field (or any alternative field you wish to use) will hold the value of the environmental variable.
This argument is standard for all CALLs to GSWINAPI. It is used to select the desired API or function, and to return the status of the operation.
Used to return the status of a call to GSWINAPI. A value of zero is a failure, any other value indicates success.
Recommended usage is to test the 88-level value WIN32API to see if it worked, then to use the text error message to see why it failed.
* ------------------------: If function failed,
|
Error code that was returned by Windows. This is not generally useful unless you have the Windows Platform SDK documentation available to you.
Plain-text error message that describes why the operation failed.
The number of these present varies depending on how many arguments are used by the desired function. These are not used, but must be present because this CALL requires seven arguments.
© 2000-2019 Norcom, all rights reserved |