Guardian Programmer's Guide

Table Of Contents
Communicating With a TACL Process
Guardian Programmer’s Guide 421922-014
8 - 21
Causing the TACL Process to Display Text
To make the TACL process display text, you must first open the TACL process as you
would any process, then write the Display message to the open file number. The
following example shows how:
?INSPECT, SYMBOLS
?NOLIST
?SOURCE $SYSTEM.SYSTEM.EXTDECS(FILE_OPEN_,WRITE,
? DEBUG)
?LIST
PROC EGCI MAIN;
BEGIN
LITERAL MAXLEN = 256;
STRUCT .DISPLAY^MSG;
BEGIN
INT MSGCODE; !set to -31
STRING TEXT[0:131]; !place holder for text
END;
INT LENGTH; !length of process file
! name
INT CI^NUM; !file number of CI
STRING .CI^NAME[0:MAXLEN - 1]; !file name of CI
! Fill in the display message with -21 for the message
! code and the text to be displayed:
DISPLAY^MSG.MSGCODE := -21;
DISPLAY^MSG.TEXT ':=' "Display this Text";
! Open the TACL process:
CI^NAME ':=' "$G55";
LENGTH := 4;
ERROR := FILE_OPEN_(CI^NAME:LENGTH,CI^NUM);
IF ERROR <> 0 THEN CALL DEBUG;
! Write the display message to the TACL process:
CALL WRITE(CI^NUM,DISPLAY^MSG,19);
IF <> THEN CALL DEBUG;
END;
Note. The recommended way of determining the name of your creator process is to obtain its
process handle using the PROCESSPAIR_GETINFO_ procedure, then pass the process
handle to the PROCESSHANDLE_DECOMPOSE_ procedure to obtain the process name.
For brevity, however, the above example simply uses the hard-coded name. For information
about the PROCESSPAIR_GETINFO_ and PROCESSHANDLE_DECOMPOSE_ procedures,
see Section
16, Creating and Managing Processes, or the Guardian Procedure Calls
Reference Manual.