Intouch Script Function Sample of InfoDosEnv and InfoWinEnv

Description

This function is used to retrieve the setting of a particular DOS environment variable. See Tech Support Script Function Library to install this function.

Use:

InfoDosEnv(EnvironmentVar);

EnvironmentVar A Message tag or quoted text (example: “PATH”) which is an environment variable that was defined in the DOS environment before Windows was started.

Returns:

A string which can be placed into a Message tag or used in place of a Message tag that contains the value of the environment variable. If the environment variable could not be located in the DOS environment, an empty string (“”) is returned.

Details of InfoDosEnv()

InfoDosEnv() returns a string of what EnvironmentVariable was set to in DOS. InfoDosEnv() reads the DOS environment as a setup before running Windows. Changes to these values in a Windows DOS Box will not be reflected in later calls to InfoDosEnv().

Example of Using InfoDosEnv()

The following is an example script that uses InfoDosEnv():

{ This is an example script to demonstrate the use of the InfoDosEnv() function }
{ DosPath is a memory message tag which will contain the entire PATH }
{ statement found in DOS. Use the String functions to parse out the }
{ components you need. }
DosPath = InfoDosEnv( “Path” );

If the current DOS path was C:\INTOUCH;C:\DOS;C:\WINDOWS, the value of DosPath, which is a Memory Message tag, would be set to “C:\INTOUCH;C:\DOS;C:\WINDOWS”.

Description

InfoWinEnv() retrieves the value of a particular attribute for the current Windows session. See Tech Support Script Function Library to install this function.

Use:

InfoWinEnv(EnvironmentVariable);

EnvironmentVariable A Message tag or quoted text (example: “ENHANCED”) which is an environment variable in the current Windows session. See Details of InfoWinEnv for a list of valid environment variables.

Returns:

InfoWinEnv() returns a character string which can be placed into a Message tag. It can also be used in place of a Message tag that contains the value of the environment variable. If the environment variable is not listed below, InfoWinEnv() will return an empty string (“”).

Details of InfoWinEnv()

InfoWinEnv() is useful if you are writing “portable” applications. As your InTouch applications migrate from Windows to Windows NT, or from node to node, your scripts must be able to know the correct action depending on their current location or set of conditions.

Here are the supported settings for the EnvironmentVariable parameter:

Variable Possible Return Values
“CPUTYPE” “80286”, “80386”,”80486″, “Unknown CPU Type”
“COPROCESSOR” “TRUE”, “FALSE”
“PAGING” “TRUE”, “FALSE”
“ENHANCED” “TRUE”, “FALSE”
“WINDOWSVERSION” Returns a string that is the version number (example: “3.11”).
“OSVERSION” Returns a string that is the version number (example: “6.0”).

Note “PAGING” determines if the current Windows system has Virtual Memory configured and selected. “ENHANCED” determines if the current Windows session is running in Enhanced Mode.

Example of Using InfoWinEnv()

The following is a script that uses InfoWinEnv():

{ This is an example script to demonstrate the use of the InfoWinEnv() function }
{ Call the function to determine which version of DOS is being used }
DosVer = InfoWinEnv( “OSVERSION” );

When the script is executed, if the version of DOS running under Windows was 6.1, then the memory message DosVer would contain the string “6.1”.

Leave a Reply

Your email address will not be published. Required fields are marked *

+ 9 = 16