THE

QUERY, EXTRACT and STATUS


The following lists the valid variables that can be queried and also shows what values are returned. For both QUERY and STATUS , the values are concatenated together and displayed as a single line. For EXTRACT the REXX variables that are set are defined. The capitalised portion of the variable is the minimum abbreviation recognised.

The bracketed text at the end of the description indicates from which commands a valid response will be supplied.
(Q-Query, E-Extract, M-Modify and S-Status).

ALT

The number of alterations to the current file since the last SAVE or automatic save via SET AUTOSAVE . Can be set by SET ALT
(QES)

alt.0- 2
alt.1- Number of alterations since last SAVE or autosave
alt.2- Number of alterations since last SAVE

ARBchar

The status of SET ARBCHAR and the ARBCHAR characters.
(QEMS)

arbchar.0- 3
arbchar.1- ON|OFF
arbchar.2- multiple match character
arbchar.3- single match character

AUTOCOLOR [*|mask]

AUTOCOLOUR [*|mask]

The status of auto colouring for the supplied file mask or "magic number". Set by SET AUTOCOLOR or SET AUTOCOLOUR . The variable name is spelt the save way that the option is specified.
(QES)

autocolor.0- 3
autocolor.1- filemask or "magic number"
autocolor.2- name of parser associated or "NULL"
autocolor.3- MAGIC (if "magic number") or empty

If no file mask or "magic number" is supplied as a parameter or * is passed, details of all parser mappings are set as follows:

autocolor.0- number of parser mappings
autocolor.1- first mapping (mask parser [MAGIC])
autocolor.n- nth mapping

AUtosave

The status of SET AUTOSAVE and/or the frequency setting.
(QEMS)

autosave.0- 1
autosave.1- OFF|n

AUTOSCroll

The status of SET AUTOSCROLL and/or the frequency setting.
(QEMS)

autoscroll.0- 1
autoscroll.1- OFF|HALF|n

BACKup

Indicates if a backup file is kept after editing and what the backup suffix is.
(QEMS)

backup.0- 2
backup.1- ON|OFF|TEMP|KEEP|INPLACE
backup.2- backup suffix string

BEEP

Indicates if the bell is sounded on display of error messages. Set by SET BEEP
(QEMS)

beep.0- 1
beep.1- ON|OFF

BLOCK

Returns information about the marked block , if any.
(QE)

block.0- 6 if a marked block exists, or 1 for NONE
block.1- type of marked block (LINE|BOX|NONE|WORD|COLUMN|CUA)
block.2- line number of start of block
block.3- column number of start of block
block.4- line number of end of block
block.5- column number of end of block
block.6- file name containing marked block

CASE

The settings related to the CASE of characters entered, searched for, changed and sorted. Set by SET CASE
(QEMS)

case.0- 6
case.1- MIXED|UPPER|LOWER
case.2- RESPECT|IGNORE
case.3- RESPECT|IGNORE
case.4- RESPECT|IGNORE
case.5- MIXED|UPPER|LOWER
case.6- MIXED|UPPER|LOWER

CLEARErrorkey

Returns the key that clears the message line . If no specific key is defined, ie ALL keys perform a reset, then * is returned. Set by SET CLEARERRORKEY .
(QEMS)

clearerrorkey.0- 1
clearerrorkey.1- keyname|*

CLEARScreen

Indicates if the screen is cleared on exit from THE. Set by SET CLEARSCREEN .
(QEMS)

clearscreen.0- 1
clearscreen.1- ON|OFF

CLOCK

Indicates if the time is displayed on the status line. Set by SET CLOCK .
(QEMS)

clock.0- 1
clock.1- ON|OFF

CMDArrows

Returns the settings for arrow key behaviour on command line . Set by SET CMDARROWS .
(QEMS)

cmdarrows.0- 1
cmdarrows.1- RETRIEVE|TAB

CMDline

The settings for the command line . Set by SET CMDLINE .
(QEMS)

If CMDLINE OFF

cmdline.0- 1
cmdline.1- OFF

If CMDLINE ON, BOTTOM or TOP

cmdline.0- 3
cmdline.1- ON|TOP|BOTTOM
cmdline.2 *- line number within window of command line
cmdline.3 *- contents of command line

* these values are only returned with EXTRACT

COLOR [*|area]

COLOUR [*|area]

Displays the current color settings for the file. Set by SET COLOR or SET COLOUR . The variable name is spelt the save way that the option is specified.

With the [ * ] option, (or no option), returns color settings for all areas of the screen.
(QE)

color.0- 40
color.1- FILEAREA followed by its color
color.2- CURLINE followed by its color
color.3- BLOCK followed by its color
color.4- CBLOCK followed by its color
color.5- CMDLINE followed by its color
color.6- IDLINE followed by its color
color.7- MSGLINE followed by its color
color.8- ARROW followed by its color
color.9- PREFIX followed by its color
color.10- CPREFIX followed by its color
color.11- PENDING followed by its color
color.12- SCALE followed by its color
color.13- TOFEOF followed by its color
color.14- CTOFEOF followed by its color
color.15- TABLINE followed by its color
color.16- SHADOW followed by its color
color.17- STATAREA followed by its color
color.18- DIVIDER followed by its color
color.19- RESERVED followed by its color
color.20- NONDISP followed by its color
color.21- HIGHLIGHT followed by its color
color.22- CHIGHLIGHT followed by its color
color.23- THIGHLIGHT followed by its color
color.24- SLK followed by its color
color.25- GAP followed by its color
color.26- CGAP followed by its color
color.27- ALERT followed by its color
color.28- DIALOG followed by its color
color.29- BOUNDMARKER followed by its color
color.30- FILETABS followed by its color
color.31- FILETABSDIV followed by its color
color.32- CURSORLINE followed by its color
color.33- DIALOGBORDER followed by its color
color.34- DIALOGEDITFIELD followed by its color
color.35- DIALOGBUTTON followed by its color
color.36- DIALOGABUTTON followed by its color
color.37- POPUPBORDER followed by its color
color.38- POPUPCURLINE followed by its color
color.39- POPUP followed by its color
color.40- POPUPDIVIDER followed by its color

With the [ area ] option, returns color settings for the specified area of the screen.
(QE)

color.0- 1
color.1- area followed by its color

COLORING

COLOURING

Displays the current color settings for the file. The variable name is spelt the same way that the option is specified. Set by SET COLORING or SET COLOURING .
(QEMS)

coloring.0- 3
coloring.1- ON|OFF
coloring.2- AUTO|parser (if coloring.1 is ON)
coloring.3- parser (if coloring.1 is ON)

COLUMN

Displays the current value of the focus column.
(QE)

column.0- 1
column.1- Column number of focus column

COMPAT

The settings for the compatibility mode. Set by SET COMPAT .
(QEMS)

compat.0- 3
compat.1- THE|XEDIT|KEDIT|KEDITW|ISPF (compatibility LOOK)
compat.2- THE|XEDIT|KEDIT|KEDITW|ISPF (compatibility FEEL)
compat.3- THE|XEDIT|KEDIT|KEDITW|ISPF (compatibility KEYS)

CTLchar [*|char]

The definitions of control characters that affect the display of reserved line s. Set by SET CTLCHAR .
(QES)

With the [ * ] option, (or no option), returns a list of all control characters that have been defined.

ctlchar.0- 1 if ctlchar.1 is OFF, otherwise 3
ctlchar.1- ON|OFF
ctlchar.2- The character defined as the escape character.
ctlchar.3- List of defined control characters, if any.

With the [ char ] option, returns color settings for the specified control character.

ctlchar.0- 1 if ctlchar.1 is OFF, otherwise 2
ctlchar.1- PROTECT|NOPROTECT|OFF
ctlchar.2- The color defined for this control character.

CURline

The value and position of the current line within the current file. Set by SET CURLINE . Also provides the contents of the focus line and an indication of the status of the focus line for the current session.
(QEMS)

With EXTRACT command:

curline.0- 6
curline.1- curline setting
curline.2- line number within window of current line
curline.3- contents of focus line
curline.4- ON|OFF (ON if line has changed or been added this session)
curline.5- OLD|OLD CHANGED|NEW|NEW CHANGED
curline.6- selection level of focus line (same as select.1)

Note: If SET COMPAT (feel) is set to XEDIT, curline.3 will always return the contents of the current line .

The setting of curline.5 is as follows: OLD: The line existed in its current form in the file before THE began. OLD CHANGED: The line was in the file before THE started, but has been changed during the current editing session. NEW: The line has been added to the file during the current edit session and not been changed. NEW CHANGED: The line has been added to the file during the current editing session and has been changed.

With QUERY , MODIFY and STATUS commands:

curline.0- 1
curline.1- curline setting

CURSor

The position of the cursor within the displayed screen and file at the time the EXTRACT /CURSOR/ is issued and the position of the cursor at the time the macro was issued. If the cursor is not in the filearea , then line and column values will be set to -1.
(QE)

cursor.0- 8
cursor.1- line number of cursor in screen (current)
cursor.2- column number of cursor in screen (current)
cursor.3- line number of cursor in file (current)
cursor.4- column number of cursor in file (current)
cursor.5- line number of cursor in screen (original)
cursor.6- column number of cursor in screen (original)
cursor.7- line number of cursor in file (original)
cursor.8- column number of cursor in file (original)

CURSORSTay

The setting for the behaviour of the cursor after a file scroll. Set by SET CURSORSTAY .
(QEMS)

cursorstay.0- 1
cursorstay.1- ON|OFF

DEFINE [key|KEY|MOUSE|*]

Returns details about the commands associated with a keyboard key or mouse key. The details returned are the same as those displayed by the SHOWKEY command. Set by DEFINE .

The following forms are available:

With no parameter or * , all details about all key and mouse event definitions are returned. (Similar to SHOWKEY ALL)
(E)

define.0- number of all definitions
define.1- command assigned to the 1st key or mouse
define.n- command assigned to the nth key or mouse

With a parameter of KEY , all details about all key definitions are returned.
(E)

define.0- number of key definitions
define.1- command assigned to the 1st key
define.n- command assigned to the nth key

With a parameter of MOUSE , all details about all mouse event definitions are returned.
(E)

define.0- number of mouse definitions
define.1- command assigned to the 1st mouse event
define.n- command assigned to the nth mouse event

With a key mnemonic specified, details about this one key are returned. The displayed output from a QUERY DEFINE is in the same format as for the DEFINE command.
(QE)

define.0- 1
define.1- command assigned to the key

DEFSORT

Specifies the order in which files are sorted in the DIR.DIR file. Set by SET DEFSORT .
(QEMS)

defsort.0- 2
defsort.1- DIRECTORY|NAME|SIZE|TIME|DATE|OFF
defsort.2- ASCENDING|DESCENDING

DIRFILEID

The value of the path and filename of the focus line in a DIR.DIR file.
(E)

dirfileid.0- 2
dirfileid.1- full path of directory
dirfileid.2- file name at focus line

If the focus line is Bottom-of-File line or Top-of-File line then:

dirfileid.0- 1
dirfileid.1- full path of directory

DIRInclude

The value of the file type masks currently in place for display in DIR.DIR file. Set by SET DIRINCLUDE .
(QEMS)

dirinclude.0- 1
dirinclude.1- list of file types shown in DIR.DIR file

DISPlay

Indicates the range of selection levels current. Set by SET DISPLAY .
(QEMS)

display.0- 2
display.1- display low value
display.2- display high value

ECOLOR [*|category]

ECOLOUR [*|category]

Displays the current color settings for syntax highlighting. Set by SET ECOLOR or SET ECOLOUR . The variable name is spelt the save way that the option is specified.

With the [ * ] option, (or no option), returns color settings for all categories.
(QE)

ecolor.0- 35
ecolor.1- A followed by its color
ecolor.2- B followed by its color
ecolor.3- C followed by its color
ecolor.4- D followed by its color
ecolor.5- E followed by its color
ecolor.6- F followed by its color
ecolor.7- G followed by its color
ecolor.8- H followed by its color
ecolor.9- I followed by its color
ecolor.10- J followed by its color
ecolor.11- K followed by its color
ecolor.12- L followed by its color
ecolor.13- M followed by its color
ecolor.14- N followed by its color
ecolor.15- O followed by its color
ecolor.16- P followed by its color
ecolor.17- Q followed by its color
ecolor.18- R followed by its color
ecolor.19- S followed by its color
ecolor.20- T followed by its color
ecolor.21- U followed by its color
ecolor.22- V followed by its color
ecolor.23- W followed by its color
ecolor.24- X followed by its color
ecolor.25- Y followed by its color
ecolor.26- Z followed by its color
ecolor.27- 1 followed by its color
ecolor.28- 2 followed by its color
ecolor.29- 3 followed by its color
ecolor.30- 4 followed by its color
ecolor.31- 5 followed by its color
ecolor.32- 6 followed by its color
ecolor.33- 7 followed by its color
ecolor.34- 8 followed by its color
ecolor.35- 9 followed by its color

With the [ category ] option, returns color settings for the specified syntax highlighting category.
(E)

color.0- 1
color.1- [ category ] followed by its color

EFILEId

The original full filename of the current file. See SET FILENAME for a full description of the components of a file name. EFILEID.2 differs from the value returned by KEDIT.
(QE)

efileid.0- 2
efileid.1- Original full file name.
efileid.2- Original file name used to edit the file.

EOF

Indicates if the current line is on the Bottom-of-File line .
(QES)

eof.0- 1
eof.1- ON|OFF

EOLout

Returns the value of the end-of-line character(s).
(QEMS)

eolout.0- 1
eolout.1- LF|CRLF|CR|NONE

EQUIVChar

Returns the equivalence character. Set by SET EQUIVCHAR .
(QEMS)

equivchar.0- 2
equivchar.1- equivalence character

ERROROUTput

Indicates if THE errors are also echoed to the calling window. Set by SET ERROROUTPUT .
(QEMS)

erroroutput.0- 1
erroroutput.1- ON|OFF

ETMODE

Indicates if extended display mode is set. Set by SET ETMODE .
(QEMS)

etmode.0- 2
etmode.1- ON|OFF
etmode.2- character ranges if not all ON or OFF

FExt

The extension of the current file. The characters following the trailing . character. Same as FType.
(QEM)

fext.0- 1
fext.1- File extension.

FIELD

Details about the current cursor field.
(QE)

field.0- 4
field.1- contents of the cursor field
field.2- character under the cursor
field.3- column position in the cursor field
field.4- COMMAND|TEXT|PREFIX

FIELDWORD

Details about the word closest to the cursor in the current cursor field.
(E)

fieldword.0- 3
fieldword.1- word as defined by SET WORD ALPHANUM
fieldword.2- word as defined by SET WORD NONBLANK
fieldword.3- starting column of word

FILEName

The full filename of the current file, including any file extension.
(QEM)

filename.0- 1
filename.1- Full file name.

FILESTATUS

Details about the status of the file being edited.
(QEM)

filestatus.0- 3
filestatus.1- sharing mode - NONE
filestatus.2- access type - READONLY|READWRITE
filestatus.3- end of line - CR/LF/CRLF/NONE

FILETABS

Indicates if the filetabs window is displayed or not.
(QEMS)

filetabs.0- 1
filetabs.1- ON|OFF

FMode

The file mode of the current file. Under Un*x, this will always return an empty string. Other platforms returns the first character of the file's path. ie the disk drive.
(QEM)

fmode.0- 1
fmode.1- File mode.

FName

The fname portion of the current file. See SET FILENAME for a full description of the components of a file name.
(QEM)

fname.0- 1
fname.1- File name.

FPath

The path name of the current file. This includes a trailing directory separator.
(QEM)

fpath.0- 1
fpath.1- File path.

FType

The extension of the current file. The characters following the trailing . character.
(QEM)

ftype.0- 1
ftype.1- File extension.

FULLFName

Indicates if the fully qualified filename is displayed on the idline .
(QEMS)

fullfname.0- 1
fullfname.1- ON|OFF

GETENV variable

The value of the supplied environment variable or ***invalid*** if the variable does not exist. On platforms other than Unix the supplied variable name is uppercased before obtaining the environment variable value.
(E)

getenv.0- 1
getenv.1- value of variable

HEX

Indicates if hexadecimal values in commands are interpreted as hexadecimal values or not. Set by SET HEX .
(QEMS)

hex.0- 1
hex.1- ON|OFF

HEADer

Returns details about which sections of a TLD file are to be applied to the current view. Do not rely on the position of a particular header in the returned stem. Set by SET HEADER .
(QE)

header.0- 11
header.1- section ON|OFF
header.2- section ON|OFF
header.3- section ON|OFF
header.4- section ON|OFF
header.5- section ON|OFF
header.6- section ON|OFF
header.7- section ON|OFF
header.8- section ON|OFF
header.9- section ON|OFF
header.10- section ON|OFF
header.11- section ON|OFF

HEXDISPlay

Indicates if the current character is displayed on the status line . Set by SET HEXDISPLAY .
(QEMS)

hexdisplay.0- 1
hexdisplay.1- ON|OFF

HEXShow

Returns details of HEXSHOW placement. Set by SET HEXSHOW .
(QEMS)

hexshow.0- 2
hexshow.1- ON|OFF
hexshow.2- line displaying first hexshow line

HIGHlight

Returns details of HIGHLIGHT settings. Set by SET HIGHLIGHT .
(QEMS)

highlight.0- 1 or 3 (if highlight.1 = SELECT)
highlight.1- OFF|ALTERED|TAGGED|SELECT
highlight.2- minimum (or only) selection level for SELECT
highlight.3- maximum selection level for SELECT

IDline [*]

Indicates if the idline is displayed for a file. Set by SET IDLINE .
(QEMS)

idline.0- 1
idline.1- ON|OFF

With [ * ] option with EXTRACT, the contents of the idline is also returned.
(E)

idline.0- 2
idline.1- ON|OFF
idline.2- contents of idline .

IMPMACro

Indicates if implied macro processing is on or off. Set by SET IMPMACRO .
(QEMS)

impmacro.0- 1
impmacro.1- ON|OFF

IMPOS

Indicates if implied operating system command processing is on or off. Set by SET IMPOS or SET IMPCMSCP .
(QEMS)

impos.0- 1
impos.1- ON|OFF

INPUTMode

Indicates the inputmode for the current view. Set by SET INPUTMODE .
(QEMS)

inputmode.0- 1
inputmode.1- OFF|FULL|LINE

INSERTmode

Indicates if currently in insert mode or overstrike mode. Set by SET INSERTMODE .
(QEMS)

insertmode.1- 1
insertmode.1- ON|OFF

LASTmsg

Return the text of the last error message generated.
(E)

lastmsg.0- 1
lastmsg.1- text of last message.

LASTKEY [n]

Return information about the last key, or the nth last key pressed. Only the last 8 keys are retained.
(E)

lastkey.0- 4
lastkey.1- name of the key.
lastkey.2- character associated with the key (if applicable)
lastkey.3- curses mnemonic code
lastkey.4- shift status. see READV for details

LASTOP [command|*]

Returns the last operand from selected commands. command can be one of ALter, Change, CLocate COUnt, Find, Locate SCHange or TFind.
(QE)

EXTract /LASTOP command/ sets:

lastop.0- 1
lastop.1- command and its last operand

If no command is supplied as a parameter or * is passed, details of all last operands are set as follows:

lastop.0- 9
lastop.1- "alter" and its last operand (not implemented)
lastop.2- "change" and its last operand
lastop.3- "clocate" and its last operand (not implemented)
lastop.4- "count" and its last operand (not implemented)
lastop.5- "find" and its last operand
lastop.6- "locate" and its last operand
lastop.7- "schange" and its last operand
lastop.8- "tfind" and its last operand (not implemented)
lastop.9- "search" and its last operand

LASTRC

Returns the return code from last command issued from command line .
(QES)

lastrc.0- 1
lastrc.1- Last return code.

LENgth

Length of the current line.
(QES)

length.0- 1
length.1- Length of current line.

LIne

Line number of focus line in current file; or current line if SET COMPAT (feel) is set to XEDIT.
(QES)

line.0- 1
line.1- Line number

LINEFLAG

Returns information about the flags set on the focus line , or current line if SET COMPAT (feel) is set to XEDIT.
(QEMS)

lineflag.0- 3
lineflag.1- NEW|NONEW
lineflag.2- CHANGE|NOCHANGE
lineflag.3- TAG|NOTAG

LINENd

Indicates if multiple commands allowed on command line and the delimiter. Set by SET LINEND .
(QEMS)

linend.0- 2
linend.1- ON|OFF
linend.2- delimiter

LScreen

Displays the size of the current screen and window. Also shows the upper left corner of the window.
(QE)

lscreen.0- 6
lscreen.1- height of current screen
lscreen.2- width of current screen
lscreen.3- screen line of upper left corner of screen
lscreen.4- screen column of upper left corner of screen
lscreen.5- height of display
lscreen.6- width of display

MACRO

Indicates if macros are executed before commands. Set by SET MACRO .
(QEMS)

macro.0- 1
macro.1- ON|OFF

MACROExt

The current setting for a macro's file extension. Set by SET MACROEXT .
(QEMS)

macroext.0- 1
macroext.1- Default file extension

MACROPath

The path that THE looks for by default for macro files. Set by SET MACROPATH .
(QEMS)

macropath.0- 1
macropath.1- Path for macro files.

MARgins

The settings for left and right margins and paragraph indent. Set by SET MARGINS .
(QEMS)

margins.0- 3
margins.1- left column
margins.2- right column
margins.3- indent value (column or offset from left margin)

MONITOR

Indicates if the combination of monitor and the curses package supports colour. If the curses package supports colour, then monitor.1 is set to COLOR and monitor.2 can be COLOR or MONO depending on whether the monitor supports colour. If monitor.1 is MONO then monitor.2 will also be set to MONO.
(QE)

monitor.0- 2
monitor.1- COLOR|MONO
monitor.2- COLOR|MONO

MOUSE

Indicates if the mouse is supported as an input device. Set by SET MOUSE .
(QEMS)

mouse.0- 1
mouse.1- ON|OFF

MSGLine

Returns details of where the message line is displayed. Set by SET MSGLINE .
(QEMS)

msgline.0- 4
msgline.1- ON
msgline.2- line position of message line
msgline.3- number of message lines available
msgline.4- OVERLAY (returned for compatibility reasons)

MSGMode

Indicates if messages are suppressed. Set by SET MSGMODE .
(QEMS)

msgmode.0- 2
msgmode.1- ON|OFF
msgmode.2- LONG

NBFile

Returns with the number of files currently in the ring .
(QES)

nbfile.0- 1
nbfile.1- Number of files in ring

NBScope

Returns with the number of lines currently in scope. If SCOPE ALL is in effect, this will be the same number as SIZE.
(QE)

nbscope.0- 1
nbscope.1- Number of lines in scope
nbscope.2- Line number of focus line in scope

NEWLines

Indicates if NEWLINES variable is set to LEFT or ALIGNED. Set by SET NEWLINES .
(QEMS)

newlines.0- 1
newlines.1- ALIGNED|LEFT

NONDisp

Returns the character that is displayed for extended characters that are not displayed. Set by SET NONDISP .
(QEMS)

nondisp.0- 1
nondisp.1- char

NUMber

Indicates if line numbers are displayed in the prefix area. Set by SET NUMBER .
(QEMS)

number.0- 1
number.1- ON|OFF

PAGEWRAP

Indicates if the scrolling the file view using the FORWARD and BACKWARD commands will wrap if the cursor is at the Bottom-of-File line or Top-of-File line respectively. Set by SET PAGEWRAP .
(QEMS)

pagewrap.0- 1
pagewrap.1- ON|OFF

PARSER [*|parser]

Displays the filename of the THE Language Defintion file from which a syntax highlighting parser was loaded. Set by SET PARSER .
(QES)

parser.0- 2
parser.1- Name of parser
parser.2- Filename of TLD file

If no parser is supplied as a parameter or * is passed, details of all parsers are set as follows:

parser.0- number of parsers currently defined
parser.1- name and filename of first parser
parser.i- name and filename of ith parser

PENDing [BLOCK] [OLDNAME] name|* [target1 [target2]

Returns information about pending prefix commands.
(E)

pending.0- 7
pending.1- line number in file
pending.2- newname - actual name entered in prefix area
pending.3- oldname - original name of macro after synonym resolution
pending.4- BLOCK or null
pending.5- value of first operand
pending.6- value of second operand
pending.7- value of third operand

Point [*]

Returns the name and line number of the focus line , or names and line numbers of all lines in a file if * is specified. If SET COMPAT (feel) is set to XEDIT, then the name and line number of the current line is returned, rather than the name and line number of the focus line .

(QE)

With no arguments:

point.0- 0 or 1 (0 if focus line not named)
point.1- line number and name of line (if line is named)

With [ * ] argument:
(E)

point.0- number of named lines in the file
point.1- line number and name for first named line
point.n- line number and name for nth named line

Only point.0 and point.1 are available using implied extract functions.

POSition

Indicates if LINE/COL is displayed on idline . Set by SET POSITION .
(QMS)

position.0- 1
position.1- ON|OFF

The current/focus line/column is also returned via EXTRACT .
(E)

position.0- 3
position.1- ON|OFF
position.2- current or focus line
position.3- current or focus column

PREfix [Synonym *|name]

Indicates if prefix is displayed for the view and if displayed where is is displayed. See SET PREFIX .
(QEMS)

prefix.0- 1 or 2 (1 if prefix.1 is OFF, 2 otherwise)
prefix.1- ON|OFF|NULLS
prefix.2- LEFT|RIGHT (if prefix.1 is ON or NULLS)
prefix.3- width of prefix area
prefix.4- width of prefix gap

With [ Synonym name ] option, the macroname associated with the synonym name is returned. If name is not a synonym then name is returned as the macroname.
(QE)

prefix.0- 1
prefix.1- synonym macroname

With [ Synonym * ] option, all prefix synonyms are returned.
(QE)

prefix.0- number of prefix synonyms
prefix.1- synonym macroname
prefix.n- synonym macroname

PRINTER

Returns the value of the printer port or spooler. Set by SET PRINTER
(QEMS)

printer.0- 1
printer.1- port or spooler name

PROFile

Returns the value of the profile file being used.
(QES)

profile.0- 1
profile.1- profile file name of blank if none being used

READONLY

Indicates if the file being edited is allowed to be altered. Set by SET READONLY .
(QEMS)

readonly.0- 1
readonly.1- ON|OFF|FORCE

REGEXP

Return the type of regular expression syntax currently used for targets. Set by SET REGEXP .
(QEMS)

regexp.0- 1
regexp.1- EMACS|AWK|POSIX_AWK|GREP|EGREP|POSIX_EGREP|SED|POSIX_BASIC
- |POSIX_MINIMAL_BASIC|POSIX_EXTENDED|POSIX_MINIMAL_EXTENDED

REPROFile

Indicates if the specified (or implied) profile file is re-executed each time a file is added to the ring. Set by SET REPROFILE .
(QEMS)

reprofle.0- 1
reprofle.1- ON|OFF

RESERved [*]

Return with list of the screen rows that have been reserved. Set by SET RESERVED .
(QES)

reserved.0- 0 if no reserved lines; 1 otherwise
reserved.1- list of screen row numbers reserved

With [ * ] option, the line number, followed by the colour specification and reserved line contents are returned; one variable for each reserved line.
(E)

reserved.0- the number of reserved lines
reserved.1- first reserved line
reserved.2- second reserved line
reserved.n- nth reserved line

REXX

Returns the version details of the Rexx interpreter (if any) in the same format as PARSE VERSION.
(QE)

rexx.0- 1
rexx.1- Version strings

REXXHalt

Returns details on when a REXX macro can be halted during execution. Set by SET REXXHALT .
(QE)

rexxhalt.0- 2
rexxhalt.1- Number of command calls or OFF
rexxhalt.2- Number of function calls or OFF

REXXOUTput

Indicates if REXX output is captured to a file or not and the line number limit of lines to be displayed. Set by SET REXXOUTPUT .
(QEMS)

rexxoutput.0- 2
rexxoutput.1- FILE|DISPLAY
rexxoutput.2- line number limit

RING

Returns details of each file being edited.
(QE)

With SET COMPAT (feel) set to XEDIT, the values set are:

ring.0- number of variables returned (ring.1 + 1)
ring.1- number of files in the ring
ring.2- IDLINE of first file in the ring
ring.3- IDLINE of second file in the ring
ring.n- IDLINE of nth file in the ring

With SET COMPAT (feel) set to THE or KEDIT, the values set are:

ring.0- number of files in the ring
ring.1- IDLINE of first file in the ring
ring.2- IDLINE of second file in the ring
ring.n- IDLINE of nth file in the ring

Only ring.0 and ring.1 are available using implied extract functions.

SCALe

Returns details of scale line . Set by SET SCALE .
(QEMS)

scale.0- 2
scale.1- ON|OFF
scale.2- line displaying scale line

SCOPE

Returns information about whether shadow line s will be affected by commands or not. Set by SET SCOPE .
(QEMS)

scope.0- 1
scope.1- ALL|DISPLAY

SCReen

Returns the number and orientation of THE screens. Set by SET SCREEN .
(QEMS)

screen.0- 2
screen.1- Number of screens displayed
screen.2- HORIZONTAL|VERTICAL

SELect

Returns the selection level of the focus line and the maximum selection level for the file. Set by SET SELECT and ALL commands. If SET COMPAT (feel) XEDIT is set, then the selection level of the current line is returned instead of the selection level of the focus line .
(QES)

select.0- 2
select.1- selection level of focus line
select.2- maximum selection level for file

SHADow

Returns the status of the display of shadow lines. Set by SET SHADOW .
(QEMS)

shadow.0- 1
shadow.1- ON|OFF

SHOWkey key

Returns the commands and parameters assigned to the key passed as an argument. This keyvalue is returned as READV.3 from a call to READV KEY.
(E)

showkey.0- the number of commands assigned
showkey.1- first command/parameter assigned
showkey.n- last command/parameter assigned

If no key supplied as a parameter:

showkey.0- 1
showkey.1- INVALID KEY

This item is not available as an implied extract function.

SIze

Returns the number of lines in the current file.
(QES)

size.0- 1
size.1- Lines in current file.

SLK [*|number]

Returns details about Soft Label Keys.

With no optional argument.
(QEMS)

UNAVAILABLE is returned if the -k switch is not supplied on command line. ON is returned if -k switch supplied and SLK are showing. OFF is returned if -k switch supplied but SLK are not showing.

With [ number ] option, details about the specific label are returned.
(QE)

slk.0- 2
slk.1- ON|OFF|UNAVAILABLE
slk.2- value of -k switch from command line

slk.0- 1
slk.1- label for SLK

With [ * ] option, details about all labels are returned.
(E)

slk.0- number of labels defined
slk.1- label for first SLK
slk.n- label of nth SLK

STATOPT [*|option]

Displays the current status options in effect on the status line . Set by SET STATOPT

With the [ * ] option, (or no option), returns settings for all options that are in effect. The returned settings are the same as the arguments specified in the SET STATOPT command.
(QE)

statopt.0- the number of status options in effect
statopt.1- the first status option in effect
statopt.2- the second status option in effect
statopt.n- the nth status option in effect

With the [ option ] option, returns settings for the specified option. If the option is invalid or has net been set, the status will be returned as OFF.
(QE)

statopt.0- 1
statopt.1- the status option settings

STATUSLine

Indicates if the status line is displayed and if so, where. Set by SET STATUSLINE .
(QEMS)

statusline.0- 1
statusline.1- TOP|BOTTOM|OFF

STAY

Indicates if the focus line stays where it is after a successful THE command or an unsuccessful LOCATE command. Set by SET STAY .
(QEMS)

stay.0- 1
stay.1- ON|OFF

SYNELEM [Cursor|row col|File line column]

Returns the syntax highlighting element at the indicated position in the file area . UNKNOWN will be returned if syntax highlighting is not active for the current file. With [ Cursor ], the default, the syntax highlighting element at the position of the cursor in the file area will be returned. NONE will be returned if the cursor is not in the file area , or if there is no syntax highlighting element at the cursor position. With [ row col ], the syntax highlighting element at the position specified by [ row ] and [ col ] (relative to the top left of the file area , (1,1), will be returned. With [ File line column ], the syntax highlighting element at the position specified by [ line ] and [ column ] (relative to the line and column in the file will be returned. If the specified file location is not in view, UNKNOWN will be returned. NONE will be returned if there is no syntax highlighting element at the specified position.

(QE)

synelem.0- 1
synelem.1- NONE|COMMENT|FUNCTION|HEADER|INCOMPLETESTRING|KEYWORD|LABEL|MARKUP|MATCH|NUMBER|POSTCOMPARE|PREPROCESSOR|STRING|UNKNOWN

SYNonym [*|name]

Indicates if synonym processing is on or off. Set by SET SYNONYM command.
(QEMS)

synonym.0- 1
synonym.1- ON|OFF

With [ name ] option, details about the defined synonym are returned.
(QE)

synonym.0- 4
synonym.1- synonym name
synonym.2- length of minimum abbreviation
synonym.3- definition
synonym.4- linend character (if specified)

With [ * ] option, details about all defined synonyms are returned.
(E)

synonym.0- number of synonyms defined
synonym.1- synonym definition of first synonym
synonym.n- synonym definition of nth synonym

TABKey

Returns settings about behaviour of TAB key. tabkey.1 indicates behaviour while not in insert mode tabkey.2 indicates behaviour while in insert mode Set by SET TABKEY .
(QEMS)

tabkey.0- 2
tabkey.1- TAB|CHARACTER
tabkey.2- TAB|CHARACTER

TABLine

Returns details of if and where the tab line is displayed. Set by SET TABLINE .
(QEMS)

tabline.0- 2
tabline.1- ON|OFF
tabline.2- line displaying tab line

TABS

Returns settings about tab columns. Set by SET TABS .
(QEMS)

tabs.0- 1
tabs.1- actual tab columns or "INCR n"

TABSIn

Indicates if TABSIN processing is on or off and the size of the tabs setting. Set by SET TABSIN .
(QEMS)

tabsin.0- 2
tabsin.1- ON|OFF
tabsin.2- size of tabs

TABSOut

Indicates if TABSOUT processing is on or off and the size of the tabs setting. Set by SET TABSOUT .
(QEMS)

tabsout.0- 2
tabsout.1- ON|OFF
tabsout.2- size of tabs

TARGETSAVE

Indicates the type of targets saved for subsequent LOCATE commands. Set by SET TARGETSAVE .
(QEMS)

targetsave.0- 1
targetsave.1- ALL|NONE|list of target types

TERMinal

Identifies the terminal type currently being used.
(QES)

terminal.0- 1
terminal.1- DOS|OS2|X11|WIN32|$TERM value under Unix

THIGHlight

Indicates if text highlighting is on. ie a found string target is highlighted. Set by SET THIGHLIGHT
(QEMS)

thighlight.0- 1
thighlight.1- ON|OFF

TIMECHECK

Indicates the status of TIMECHECK for the current file.
(QEMS)

timecheck.0- 1
timecheck.1- ON|OFF

TOF

Indicates if the current line is on the Top-of-File line .
(QES)

tof.0- 1
tof.1- ON|OFF

TOFEOF

Indicates if the Top-of-File line and the Bottom-of-File line are displayed.
(QEMS)

tofeof.0- 1
tofeof.1- ON|OFF

TRAILING

Indicates how trailing blanks on lines are handled when the file is saved. Set by SET TRAILING
(QEMS)

trailing.0- 1
trailing.1- ON|OFF|REMOVE|EMPTY|SINGLE

TYPEAhead

Indicates if THE will wait until all keyboard input has been processed before updating the screen display. Set by SET TYPEAHEAD .
(QEMS)

typeahead.0- 1
typeahead.1- ON|OFF

UNDOING

Indicates if the undo facility is available or not. Set by SET UNDOING
(QEMS)

undoing.0- 1
undoing.1- ON|OFF

UNTAA

Indicates if "unsigned numbers are absolute". Set by SET UNTAA
(QEMS)

untaa.0- 1
untaa.1- ON|OFF

UTF8

Indicates if the UTF8 support is built in.
(QES)

utf8.0- 1
utf8.1- ON|OFF

Verify

Returns verify column settings. Set by SET VERIFY .
(QEMS)

verify.0- 1
verify.1- Column pair of verify start and end columns.

VERShift

Returns the value of the vershift internal variable.
(QES)

vershift.0- 1
vershift.1- VERSHIFT value

VERSION

Returns information about name of application (THE) and version information.
(QES)

version.0- 5
version.1- THE
version.2- version string e.g. 1.5
version.3- platform version (DOS,OS2,UNIX,X11,WIN32,...)
version.4- version status information e.g. release date, beta
version.5- platform kernel (DOS,OS2,Linux,WIN32,...)

Width

Returns maximum line width setting. Set by -w command line switch on starting THE.
(QEMS)

width.0- 1
width.1- Maximum line width value.

WORD

Specifies how THE defines a word. Set by SET WORD .
(QEMS)

word.0- 1
word.1- ALPHANUM|NONBLANK

WORDWrap

Indicates if WORDWRAP is on or off. Set by SET WORDWRAP .
(QEMS)

wordwrap.0- 1
wordwrap.1- ON|OFF

WRap

Indicates if WRAP is on or off. Set by SET WRAP .
(QEMS)

wrap.0- 1
wrap.1- ON|OFF

XTERMinal

Returns the current value of the X11 terminal program. Only applicable in X version. Set by SET XTERMINAL .
(QEMS)

xterminal.0- 1
xterminal.1- X11 terminal program

Zone

Returns zone column settings. Set by SET ZONE .
(QEMS)

zone.0- 2
zone.1- Zone start column
zone.2- Zone end column


IMPLIED EXTRACT


The above REXX variables set by the EXTRACT command may also be obtained by a REXX macro as an implied EXTRACT. Each variable above that may be set by an explicit EXTRACT command may also be e.g. The REXX commands:


'EXTRACT /SIZE/CURLINE/'
Say size.1 curline.1

may be substituted with:


Say size.1() curline.1()


BOOLEAN FUNCTIONS


THE also provides other information to the REXX interpreter via boolean functions. These functions return either 1 or 0 depending on the information queried.

after()

Returns 1 if the cursor is currently after the last non-blank character on the line, or if the line is blank.

altkey()

Returns 1 if at the time the last key was pressed, the ALT key was also being held down.

alt()

Returns 1 if the file being edited has changed since the last SAVE. i.e. if the value of alt.2 is non zero.

blank()

Returns 1 if the line the cursor field is completely blank.

batch()

Returns 1 if THE is being run in batch mode. ie THE was started with the -b switch.

block()

Returns 1 if the marked block is within the current view.

before()

Returns 1 if the cursor is currently before the first non-blank character on the line, or if the line is blank.

bottomedge()

Returns 1 if the cursor is on the bottom edge of the filearea or prefix area .

command()

Returns 1 if the command line is on. This is different to the definition in KEDIT; "Returns 1 if the cursor is on the command line." To get the equivalent KEDIT functionality use incommand();

ctrl()

Returns 1 if at the time the last key was pressed, the CTRL key was also being held down.

current()

Returns 1 if the cursor is on the current line .

dir()

Returns 1 if the current file is the special DIR.DIR file.

end()

Returns 1 if the cursor is on the last non-blank character on the line.

eof()

Returns 1 if the cursor is on the Bottom-of-File line and the cursor is not on the command line .

first()

Returns 1 if the cursor is in column 1 of the current window.

focuseof()

Returns 1 if the focus line is the Bottom-of-File line whether the cursor is on it or not.

focustof()

Returns 1 if the focus line is the Top-of-File line whether the cursor is on it or not.

inblock()

Returns 1 if the cursor is in the marked block .

incommand()

Returns 1 if the cursor is on the command line .

initial()

Returns 1 if the function is called when THE is executing the profile against files specified on the Operating System command line. Once THE is ready to accept the first keystroke, not as a result of a command from within profile , this function returns 0;

inprefix()

Returns 1 if the cursor is located in the prefix area .

insertmode()

Returns 1 if THE is in INSERT mode.

leftedge()

Returns 1 if the cursor is on the left edge of the filearea .

modifiable()

Returns 1 if the cursor is located in an area that can be changed. i.e. not on Top-of-File line or Bottom-of-File line nor on a shadow line .

rightedge()

Returns 1 if the cursor is on the right edge of the filearea .

shadow()

Returns 1 if the cursor is on a shadow line .

shift()

Returns 1 if at the time the last key was pressed, the SHIFT key was also being held down.

spacechar()

Returns 1 if the cursor is on a space character.

tof()

Returns 1 if the cursor is on the Top-of-File line and the cursor is not on the command line .

topedge()

Returns 1 if the cursor is on the top edge of the filearea .

verone()

Returns 1 if the column 1 of the file is being displayed in column 1.


OTHER FUNCTIONS


The following functions provide features to simplify THE macros written in REXX.

valid_target(target[,anything])

The first argument is the target to be validated. If a second, optional argument is supplied, the target to be validated can consist of a target followed by any optional characters. This can be useful if the arguments to a macro consist of a target followed by another argument. If a valid target is supplied, the remainder of the string passed to valid_target() is returned following the first line affected and the number of lines to the target.

Returns ERROR if the supplied target is invalid. Returns NOTFOUND if the supplied target is valid, but not found.

If a valid target, returns the first line affected by the target followed by the number of lines to the target, and optionally the remainder of the argument. e.g.

if the focus line is 12 and valid_target() is called as


result = valid_target(":7") ===> result = "12 -5"

if the focus line is 12 and valid_target is called as


result = valid_target(":7 /fred/",junk), ===> result = "12 -5 /fred/"

run_os(command[,stdin_stem[,stdout_stem[,stderr_stem]]])

This function allows the macro writer to call an operating system command and have the standard streams; stdin , stdout and stderr redirected to or from REXX arrays.

The first argument is the operating system command to execute. The command can include any command line switches appropriate to the command.

All other arguments comprise a stem name (including a trailing . ) which refers to the REXX arrays where stdin , stdout and stderr are to be redirected.

As with all REXX arrays, the value of the 0th element (stem.0) contains the number of elements in the array.

The only restriction with the names of the stem variables is that the stem name for the stdin stem cannot be the same as the stem for stdout or stderr .

The stem name for stdout and stderr can be the same; the contents of the resulting output stems will consist of stdout and stderr in the order that the command generates this output.

Return values:

0 - successful
1005 - invalid argument or syntax
1012 - problems with system redirection of streams
1094 - out of memory
1099 - error interfacing to REXX interpreter
all other numbers, return code from operating system command

e.g. to spell check the words "The Hessling Editr" with ispell


in.0 = 3
in.1 = "The"
in.2 = "Hessling"
in.3 = "Editr"
rc = run_os("ispell -a","in.","out.")

sets:

out.0 --> 3
out.1 --> "*"
out.2 --> "#"
out.3 --> "& edits edit editor"

The Hessling Editor is Copyright © Mark Hessling, 1990-2016 <mark@rexx.org>
Generated on: 24 Aug 2016

Return to Table of Contents