AUI_ENVIRONMENT

xcall AUI, AUI_ENVIRONMENT, opcode, guiflags

References to XP removed 7/20. Jack may have reviewed.The AUI_ENVIRONMENT class keeps track of properties and capabilities of the interface environment that affect the kind of user interface a program should use. It supports two methods, get (0) and set (1) GUI flags. (As a practical matter you would probably never set any of these properties yourself. They are set automatically by A-Shell when a session is launched.) This routine is equivalent to MX_GUIFLG.   

Support has been added for another opcode, 2, which is like 0 (get flags) but doesn't query the ATE client to find out if it has Windows theme support or not. This is probably only useful within a repetitively-called SBX where you need to determine whether you can use ATE/GUI methods or must stick with text methods, but for performance reasons you want to avoid excessive communication with the client and it doesn't make any difference to your logic whether themes are active.

Values for guiflags are shown in the following table, and are defined in ashell.def.

Symbol

Value

Description

AGF_LWG

&h0001

Local Windows w/ GUI (e.g. PCTDVG)

AGF_LWN

&h0002

Local Windows w/o GUI (e.g. PCTDV)

AGF_ATE

&h0004

Running on server via ATE connection

AGF_RWN

&h0008

Remote windows (ATS)

AGF_TNT

&h0010

Telnet

AGF_ASH

&h0020

A-Shell

AGF_THEMES

&h0040

Windows Themes are active

AGF_HOLDKBD

&h0080

Client currently holding kbd

AGF_ATERES

&h0100

Currently waiting on ATE response

AGF_LOCWIN

&h0003

Local Windows (AGF_LWN or AGF_LWG)

AGF_ANYWIN

&h000B

Any windows platform (_LWN or _LWG or _RWN)

AGF_GUIEXT

&h0005

GUI extensions avail (AGF_LWG or AGF_ATE)

AGF_LWNATE

&h0007

Local Windows or ATE

AGF_ATECLI

&h0200

Running on ATE client (i.e. inside TELNET.LIT)

AGF_INPROC

&h0400

TAB(-10,x) command in progress

AGF_DESIGN

&h1000

Design mode

AGF_NOSTATUS

&h2000

Disable the return of cstatus information

Hex-Decimal Values

 

Here are some examples of using this information. All of them would start with retrieving the current guiflags as follows:

xcall AUI, AUI_ENVIRONMENT, 0, GUIFLAGS       ! retrieve GUI flags

Before creating a graphical user interface with components from the AUI CONTROL class, you might want to check for either AGF_LWG or AGF_ATE. Since these are combined in AGF_GUIEXT, we can simply check it as follows:

if (GUIFLAGS and AGF_GUIEXT) then ? TAB(-10,x);.....

If you wanted to display a file for the user, either using NOTEPAD (if applicable) or else EZTYP (if not), you might use the following logic:

if (GUIFLAGS and AGF_LOCWIN) then &

xcall HOSTEX,"NOTEPAD "+F$ &

else if (((GUIFLAGS and AGF_ATE)#0) and &

((GUIFLAGS and AGF_TNT)#0)) then &

call XFER'TO'PC :&

call LAUNCH'NOTEPAD'ON'CLIENT &

else &

xcall EZTYP,F$

 

In the above example, if running Windows locally, we can just launch NOTEPAD using HOSTEX.SBR. Otherwise, if running ATE on the client over telnet, we could transfer the file to the PC and then launch NOTEPAD, both of which could be done via Tab(-10,x) commands. Otherwise, we could just use EZTYP on the server. (You might also want to test for other telnet emulators, such as ZTERM, which are capable of doing file transfers and launching commands on the client, but that exceeds the scope of this example.) Note that when testing multiple AND conditions, you need the extra set of parentheses and the #0 test as shown above to get the desired effect. Otherwise the confusion between the logical and arithmetic AND in BASIC will cause the test to fail.

If you merely wanted to test whether you were running under A-Shell Windows or A-Shell/UNIX (or some other platform, presumably AMOS), you could do this:

if (GUIFLAGS and AGF_ASH) then       ! running A-Shell

if (GUIFLAGS and AGF_ANYWIN)      ! any Windows platform

? "A-Shell Windows"

else

? "A-Shell UNIX"

endif

else

? "Non A-Shell (AMOS?)"

endif

 

History

2006 January, A-Shell 4.9.949:  The following will return the ATE version if the fourth parameter is specified and the client is ATE.

xcall AUI, AUI_ENVIRONMENT, 0, FLAGS {,ATEVER$}