Please enable JavaScript to view this site.

A-Shell Reference

xcall TRMCHR, status, trmchr'map

TRMCHR 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. The A-Shell implementation is a compatible super-set of the AMOS version.  

Parameters

status (F)  [out]

Returns 0 for success. (Actually it does nothing under A-Shell, since there is no way for it to fail.)

trmchr'map

A structure which must be mapped as specified. Typically you would access the standard copy via ++include ashinc:trmchr.map). All fields are output only, except for TRMCHR'WINROW. See the following topic TRMCHR'MAP for full details.

Comments

See the sample program TRMCHR.BAS in EXLIB:[908,28], and the trmchr.bsi and trmchr.map include files in ASHINC.

History

2005 January, A-Shell 4.9.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 subroutine 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.)

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 subroutine. In that case, TRMCHR 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.)