Along Dan's reply. IOF is the variable that
hold the code to perform a "form feed" or "top of form" function
on the device.
STANDARD DATA DICTIONARY #3.2 -- TERMINAL TYPE
FILE JUN
3,2012@19:22:57 PAGE 1
STORED IN ^%ZIS(2, (188 ENTRIES) SITE: Vista-Office EHR UCI:
WVDEV,WVDEV (VERSION 8.0)
DATA NAME GLOBAL DATA
ELEMENT TITLE LOCATION TYPE
-----------------------------------------------------------------------------------------------------------------------------------
3.2,2 FORM FEED 1;2 FREE TEXT (Required)
INPUT TRANSFORM: D CHECK^%ZISS1,FORM^%ZISS1
K:$L(X)>70!($L(X)<1) X
HELP-PROMPT: ARGUMENT OF MUMPS 'WRITE' TO CLEAR
SCREEN OR GO TO TOP-OF-PAGE
DESCRIPTION: The argument of a MUMPS WRITE
statement that will set the top-of-form for the use of tractor-feed
paper on a printer, or will clear
the screen of a video display terminal.
NAME FORM FEED
------------------------------------------------------------------------------------------------------------------------------------
C-3101 #,$C(27,76)
C-ADDS #
C-ADM3 #,$C(26)
C-DATAMEDIA #
C-DATATREE #
C-DEC
$C(27)_"[2J"_$C(27)_"[24A"_$C(27)_"[80D",#
C-DEC132
$C(27)_"[2J"_$C(27)_"[24A"_$C(27)_"[80D",#
C-FALCO #,$C(27)_"~*"
C-H1500 #,$C(126,28)
C-HINQLINK #,$C(27,91,50,74,27,91,72)
C-HP110 #,$C(27,72,27,74)
C-HP2621 #,$C(27,72,27,74)
S IOF="#,$C(27,72,27,74)"
W IOF
#,$C(27,72,27,74)
You want the code in IOF to be resolved, not printed as a literal
string. In this case besides the "#" you want MUMPS to send the
ASCII code represented by the characters 27,72,27, and 74 to the
device.
The "!" is not sent to the external system. It's the signal
(command) to the MUMPS interpreter to send whatever characters have
accumulated in the output buffer. That's how MUMPS interfaces to a
TCP/IP (network) connection. When it encounters the flush command it
takes the data in the buffer and sends it out the connection. TCP/IP
then puts it into a packet(s) on the network based on the packet
size specified for your system. Otherwise you could be sending out
hundreds of TCP/IP packets each with one character which would be
very inefficient.
You probably need to
WRITE I," HELLO",$CHAR(13,10),@IOF - the IOF tells MUMPS to flush the characters from the buffer and send out the wire.