To Send Data to the Printer
You can control what information is printed by using an APL shared
variable. You specify the operation as follows:
SV+ 'PRT [MSG
=
OFF]'
+
The shared variable is used for printing data.
For example (assume SV is already established as a shared variable):
o
0
SV<i" ' P
I~~T
M~:)G::::OFF'
SV
Once the operation is specified, only the information (a character
scalar or vector) assigned to the shared variable is printed. The I/O
processor assigns a return code to the shared variable after each print
operation. For example:
o
0
o
0
SV~'ONLY
THE DATA ASSIGNED'
SV
SV~'TO
THE SHARED VARIABLE IS PRINTED'
SV
When using a shared variable for print operations, you can only assign
character scalars or vectors to the shared variable. However, you can
also print a matrix as follows:
:I
':>
• A ..
MATRIX~~
2p'123~5678'
r1ATI~I)<
/Carriage return character (assuming
OIO~1)
.
o ()
o
0
. /
~
This expression catenates a carriage
C R
~"
[] AV
I:: :I. ~,:j 'l
::1.------
return character at the end of each
(:' V
<i" ,',
' I
I
( ..
M A, ' Y ' I:) '[ ''''')
('~ I~)
d
~"*I,fl
",l\
} " ' j
BV
• :>
!:~
VV
' < 1:" \
0
Terminate the
operation.
row of the matrix and then ravels
the matrix into a vector, as follows:
1 2 CR 3 4 CR 5 6 CR 7 8 ~ ~ The last
CR is dropped .
Now, when the vector is printed,
a new line is started each time
the carriage return is encountered,
as follows:
1 2
34
56
78
I nputlOutput Control
137