Get ATE Environment Variable

? tab(-10, AG_GETENV);"var,1"; chr(127);

AG_GETENV (45) will return (in the keyboard buffer) the definition of the specified environment variable as defined to the ATE client (or A-Shell/Windows). In addition to the proper environment variables, the command will also recognize two special ones that are only understood by this command within the ATE client: %ATEEXE% (the full filespec of the client executable, e.g. "c:\Program Files\MicroSabio\ATE\bin\ashw32.exe") and %ATEVER% (the version string for the client executable, e.g. "4.9(930)-1").

If the ",1" is appended to the environment variable name, as shown above, then the result will be "de-mangled" (i.e. converted from the DOS 8.3 compressed format to the full long format), if possible. For example:

? TAB(-10,AG_GETENV);"TEMP",chr(127);

The above command (without the ,1) might return something like:

C:\DOCUME~1\yourname\LOCALS~1\Temp

Using the new syntax, with the,1, the command:

? TAB(-10,AG_GETENV);"TEMP,1",chr(127);

might return something like:

C:\DOCUMENTS AND SETTINGS\yourname\LOCAL SETTINGS\Temp

See Also

MX_GETENV for retrieving an environment variable from the application server—as opposed to client—machine.

History

2009 October, A-Shell 5.1.1163:  The pseudo-environment variable ATELICMODE is supported in AG_GETENV to return a single decimal value containing flags indicating how the ATE workstation was licensed. The bottom 8 bits of the value are 0 if successfully licensed, else one of the LICF_xxx flags from ASHINC:ASHELL.DEF. The next byte(s) contain one or more bit flags from ATELF_xxx:

Symbol

Value

Meaning

ATELF_PROTO

&h0100

ATE handshake was initiated, and also that the ATE client is at least 5.1.1164.0. (Prior to that, the command ? TAB(-10,AG_GETENV);"ATELICMODE";chr(127) will return an empty string.

ATELF_PC

&h0200

ATE client has a local license.

ATELF_SRV1

&h0400

The server attempted to pass the ATE license via the new streamlined protocol (1162+)

ATELF_SRV2

&h0800

The server attempted to pass the ATE license via the LICENS/ATESRV mechanism. This also implies that the server is less than 5.1.1162.0 and/or that the passed license wasn't valid (in which case the lower byte should be <>0).

ATELF_AUX

&h1000

The server attempted to pass an auxiliary license to the client. (Will always be combined with ATELF_SRV2.)