$ZPOUT

When $PRINCIPAL has different input/output devices, the USE command recognizes intrinsic special variables $ZPOUT to apply appropriate deviceparameters to the output side of $PRINCIPAL. A USE with $ZPOUT sets $IO to $PRINCIPAL for READs and WRITEs from the input and output side of $PRINCIPAL. $ZSOCKET() also accepts $ZPOUT as its first argument and, if the device is a split SOCKET device, supplies information on the output SOCKET device. In any context other than USE or $ZSOCKET(), or if $PRINCIPAL is not a split device, $PRINCIPAL, $ZPIN and $ZPOUT are synonyms. In the case of a split $PRINCIPAL, $ZPOUT returns the value of $PRINCIPAL followed by the string "> /" Any attempt to OPEN $ZPOUT results in a DEVOPENFAIL error.

For more information refer to “$Principal”, “$ZPIN”, and “$ZSOCKET()”.

Example:

;zpioin
;123456789012345678901234567890123456789012345678901234567890
;A12345678901234567890123456789012345678901234567890123456789
zpio
  ; mumps -r zpio < zpioin
  write "$PRINCIPAL = ",$P,!
  write "$ZPIN = ",$ZPIN,!
  write "$ZPOUT = ",$ZPOUT,!
  write "Read first line from zpioin with default settings",!
  read x
  write x,!
  zshow "d"
  use $ZPIN:(wrap:width=50)
  write "After $ZPIN set to wrap and width set to 50",!
  zshow "d"
  write "Read next 50 characters from zpioin",!
  read y
  write y,!
  use $ZPOUT:wrap
  use $ZPIN:nowrap
  write "After $ZPOUT set to wrap and $ZPIN set to nowrap",!
  zshow "d"
  use $ZPOUT:nowrap
  write "After $ZPOUT set to nowrap",!
  zshow "d"
  use $P:wrap
  write "After $P set to wrap",!
  zshow "d"
  use $ZPOUT:width=40
  write "After $ZPOUT width set to 40",!
  zshow "d"
  use $ZPOUT:nowrap
  write "After $ZPOUT set to nowrap",!
  zshow "d"
  write x,!
  quit