
Using $RECEIVE
Initiating and Communicating With Processes
5–22
107365 Tandem Computers Incorporated
For nowaited communication, TACL sends the WRITEREAD and continues
executing code. Each time you append a line to prompt_var, the TACL process
reads a record from $T1 and appends it to
read_var
. To open a running process
and specify nowaited communication, issue a #REQUESTER READ call without
the WAIT option. The following statement opens $T1 for nowaited I/O:
#REQUESTER READ $T1 error_var read_var prompt_var
To wait for completion of the read operation, and when you are finished writing to
the process, use the #WAIT built-in function to wait until
read_var
contains
data. To avoid writing over data that has not yet been transmitted, use #WAIT to
make sure the previous operation has finished.
Sending Messages to a Process
The following examples show how to use #REQUESTER to communicate with
processes.
Use the routine in Figure 5-10,
send
, to open a terminal and write a message to line 25
of the terminal. The syntax is:
send
device-id text
The #OUTPUT statements
output_help_text
in this example do not follow the
indentation style guidelines in Section 1, “An Overview of TACL.” This modification
avoids extra spaces in the display.
Figure 5-10. Sending Messages to a Terminal (Page 1 of 3)
?SECTION send ROUTINE
[#CASE [#EXCEPTION]
|_CALL| == code to execute when first entering the routine
#FRAME
[#PUSH error_message,
destination_name,
message,
temp_message,
error,
send_message,
req_status,
output_time,
origin_time,
origin_time_hh,
origin_time_mm]
|_ERROR| == code to execute when an _ERROR is detected
#ERRORTEXT /CAPTURE error_message/
#OUTPUT Send Terminated - Error: [error_message]
#UNFRAME
#RETURN