| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
FreeM implements several important pieces of functionality in the ^$DEVICE SSVN.
The first subscript of ^$DEVICE represents the I/O channel of an OPENed device.
The following values for the second subscript are supported:
$DEVICEReturns the value of $DEVICE for the specified I/O channel.
$X +R -U -DReturns the horizontal cursor position of a terminal device. Only valid if the I/O channel is 0.
$Y +R -U -DReturns the vertical cursor position of a terminal device. Only valid if the I/O channel is 0.
ROWS +R -U -DReturns the number of character rows on the terminal device. Only valid if the I/O channel is 0.
COLUMNS +R -U -DReturns the number of character columns on the terminal device. Only valid if the I/O channel is 0.
CHARACTER +R -U -DReturns the character set of the specified I/O channel; always M in the current implementation.
INPUT_BUFFER +R +U -DReturns or sets the contents of the input buffer for the specified I/O channel. Data populated in this node will remain in the buffer until subsequent READ command(s) remove it. This can be used to perform input buffer stuffing, i.e., to fill out an interactive form programmatically.
NAME +R -U -DReturns the operating system’s name for the file, device, or socket attached to the specified I/O channel.
FD +R -U -DReturns the UNIX file descriptor of the specified I/O channel.
MODE +R -U -DReturns one of READ, WRITE, READWRITE, or APPEND, depending on the mode in which the specified I/O channel was opened.
EOF +R -U -DReturns 1 if the I/O channel has encountered an end-of-file condition; 0 otherwise. Only valid if the I/O channel is connected to a sequential file.
LENGTH +R -U -DReturns the length of the file connected to the I/O channel. Only valid if the I/O channel is connected to a sequential file.
NAMESPACE +R -U -DReturns the current mnemonic-space in use for the referenced I/O channel. Always X364 for terminals and blank for sequential files.
TYPE +R -U -DReturns either 1,FILE, 2,SOCKET, or 4,TERMINAL, depending on the device type associated with the specified I/O channel.
OPTIONS -R -U -DThe following subscripts reside beneath ^$DEVICE(<io-channel>,"OPTIONS"), and this subscript may not be accessed without one of the following third-level subscripts being specified:
DSW +R +U -DSets or returns the current Device Status Word controlling terminal characteristics. Only valid for I/O channel 0.
TERMINATOR +R +U -DSets or returns the READ terminator for the specified I/O channel. Must be either $C(13,10) or $C(10). Currently only supported for socket devices (those having an I/O channel of 100-255).
TERMID +R -U -DReturns the type of terminal connected to channel 0. Only valid for I/O channel 0.
ECHO +R +U -DEnables or disables local echo of characters typed in a READ command. Only valid for I/O channel 0. Corresponds to bit 0 of the Device Status Word.
DELMODE +R +U -DEnables or disables visual backspace during a READ command. Only valid for I/O channel 0. Corresponds to bit 2 of the Device Status Word.
ESCAPE +R +U -DEnables or disables escape sequence processing during a READ command. Only valid for I/O channel 0. Corresponds to bit 6 of the Device Status Word.
CONVUPPER +R +U -DEnables or disables automatic conversion to uppercase of alphabetical characters during a READ command. Only valid for I/O channel 0. Corresponds to bit 14 of the Device Status Word.
DELEMPTY +R +U -DEnables or disables the automatic deletion of empty strings supplied to a READ command. Only valid for I/O channel 0. Corresponds to bit 19 of the Device Status Word.
NOCTRLS +R +U -DTBD. Only valid for I/O channel 0. Corresponds to bit 20 of the Device Status Word.
CTRLOPROC +R +U -DEnables or disables Ctrl-O processing during READ commands. Only valid for I/O channel 0. Corresponds to bit 21 of the Device Status Word.
NOTYPEAHEAD +R +U -DEnables or disables typeahead buffering during READ commands. Only valid for I/O channel 0. Corresponds to bit 25 of the Device Status Word.
Example
The following example M code opens /etc/freem.conf and reads its contents line-by-line until the end of the file is reached.
SET ^$JOB($JOB,"IOPATH")="/etc" ; set I/O path to /etc OPEN 1:"freem.conf/r" ; open freem.conf for reading ; ; read until we run out of lines ; FOR USE 1 READ LINE USE 0 QUIT:^$DEVICE(1,"EOF") D . WRITE LINE,! ; CLOSE 1 QUIT
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on May 19, 2025 using texi2html 5.0.