xcall TRMCHR, status, trmchr'map
TRMCHR.SBR provides a means to determine various characteristics of the terminal running your program. The current number of rows and columns, foreground and background colors, and other information is available.
A-Shell includes both a TRMCHR.BAS sample program, and a TRMCHR.BSI sample include file.
TRMCHR is a direct and exact replacement for the AMOS subroutine of the same name. Refer to the AlphaBASIC XCALL Subroutine User's Manual (PDF) for complete information.
History
2005 January - Build 915
A-Shell/Windows Extension: Under A-Shell/Windows GUI mode, if there is a standard modal dialog box open at the time of the XCALL TRMCHR, WINROW and WINCOL will be set to the usable number of rows and columns in the dialog box.
A-Shell/Server/ATE Extension: Under A-Shell/UNIX (or A-Shell/Windows on a telnet server with ATSD), if the client is ATE, then there is a possible ambiguity in TRMCHR over whether the information returned should be from the server or the client side. In most cases, these will agree, except for the case of WINROW and WINCOL, since dialog box information may only be known to the client. (The server application would have given the command to create the dialog box, but that information, and especially the knowledge of whether the dialog box is still open on the client, is not necessarily available to TRMCHR.SBR.)
To resolve the ambiguity, if you want the WINROW / WINCOL information to return information about a dialog box displayed on the ATE client, you must set WINROW to -1 prior to the XCALL. In that case, TRMCHR.SBR will query the client for all of the information. Otherwise, it will just use the server's view of the terminal status, which, as of build 915, will mean that the WINROW and WINCOL fields will come back 0. To clarify, the main reason why you would want to set WINROW to -1 before XCALL TRMCHR is if you are interested in knowing the size of the current dialog box on the client display, if any. (It makes no difference under A-Shell/Windows what you set WINROW to, since it always returns the client information in that case.)