| Zap 'HelpData' file. This file contains:
|
| 1. Documentation on all Zap commands stored in the Zap module.
| 2. Help text for Zap interactive help.
|
| The data in this file is used by the 'Help' command (^H) and the !Help
| Application.
|
| The file format consists of paragraphs of the form:
|
| <label> [<comment>]
| <paragraph of help text>
|
| where label is one of:
|
|   <command>		help text for command <command>
|   @<function>		help text for function <function>
|   window.<name>	help for leaf window with template called <name>
|   mode_<name>		help for a window in mode called <name>
|   zap.icon		help for Zap's main iconbar icon.
|
| The commands should be kept in alphabetical order as far as possible.
| NB Only the first 4 lines get displayed by the !Help application.
|    Use ^H for more details.

| Main icon

zap.icon
This is the Zap application.
Zap is a text editor.
Click SELECT to open a new text file.
Drag a file onto this icon to load it.

| Window in mode 'n'

mode_text
Text editing mode.
Click SELECT to position the cursor.
Click ADJUST to re-enable the cursor at its current position.
Drag SELECT to set a selection or ADJUST to alter a selection.
Double click to select a word.
Treble click to select a line.
Quadruple click to select a paragraph.
Quintruple click to select the whole text.

mode_byte
Byte editing mode.
Toggle hex entry mode via sF3 and insert/overwrite mode via the Insert key.
In hex entry mode keys 0-9,A-F,a-f enter hex bytes.
While not in hex entry mode letters enter their Ascii values.

mode_word
Word (32 bit) editing mode.
Toggle hex entry mode via sF3 and insert/overwrite mode via the Insert key.
In hex entry mode keys 0-9,A-F,a-f enter hex words.
DELETE deletes a whole word.
Use undo (F8 or Shift <-|) to remove the last digit typed.

mode_ascii
ASCII editing mode.
Type characters to insert them.
Same as text mode except there is no return character.

mode_code
Assembler instruction examining mode.
Press RIGHT arrow to follow a branch and LEFT arrow to go back.
Press RIGHT arrow or cI to indirect through the current address.
Press RETURN to edit the current instruction.
The instruction is assembled by BASIC so you can use any basic FNs.
You can also use EQUD and EQUS but only the first 4 bytes will count.

mode_throwback
This is a Zap throwback window.
Double click SELECT or press RETURN on a line to go to the match.
Treble click SELECT to jump to the match and bring the window to front.
Click ADJUST or press DELETE on a line to remove the line.
Double click SELECT with Shift held to jump & remove the throwback file.

| Leaf windows

window.ColourBox
This is the Zap 24 bit colour selector.
Press one of the 16 wimp colours to set that colour.
Drag the bars then click on 'Set' to set a general colour.
Font sub-styles may also be selected from here.

window.DyingBox
Click SAVE    (or press S) to save the file before it is discarded.
Click DISCARD (or press D) to delete the file.
Click CANCEL  (or press C) to cancel this dialogue.

window.DzapBox
Type the filing system name (CASE SENSITIVE) and then press RETURN.
The default drive number should then be filled in for you.
Type the drive number then RETURN to change drive.
Press READ SECTOR to read the disc.

window.GotoBox
This window displays your current position in the text.
Type the line number or address you wish to move to in the file.
You may use expressions (eg '&100+32*78').
Press CTRL U to clear the buffer.

window.InfoBox
This is the Zap info window.
The application Zap is copyright Dominic Symes - see 'Copyright' file.
Click on the button for a list of mode authors.
See the 'Copyright' file for the relevant address.

window.LoadBox
Click on EDIT (or press E) to load the file into a separate buffer.
Click on OVERWRITE (or press O) to replace the current buffer.

window.MacroBox
The small boxes give the macro to match.
The large boxes give the text to replace the macro with.

window.MiniBuf
This is the Zap minibuffer.
Drag with SELECT to move.
Drag near the right hand edge to resize.
Press ESCAPE to leave the minibuffer.

window.MoveBox
Click on 'Last cylinder' (or press X) to move backwards by one cylinder.
Click on 'Next cylinder' (or press C) to move forwards  by one cylinder.
Click on 'Last track'    (or press R) to move backwards by one track.
Click on 'Next track'    (or press T) to move forwards  by one track.
Click on 'Last sector'   (or press A) to move backwards by one sector.
Click on 'Next sector'   (or press S) to move forwards  by one sector.

window.MzapBox
Drag the 'switcher' icon to a window/icon belonging to the task you want.
Press RETURN or click on READ.
Drag to a Zap taskwindow to read the taskwindow memory.

window.NextBox
Click REPLACE (or press R, M or RETURN) to replace one match.
Click SKIP    (or press S) to move to the next match without replacement.
Click LAST    (or press L) to replace one match and then abort.
Click CANCEL  (or press C or Q) to abort the replacing session.
Click UNDO    (or press U) to undo the last operation on the file.
Click REDO    (or press D) to redo the most recent undo operation.
Click ALL     (or press A, T or E) to replace all additional matches.
Click IN SEL  (or press I) to replace all matches in the current selection.

window.PrintBox
Prints a file by use of the !Printers (printer driver) application.
Printing uses the outline font selected via the display menu.
Press PRINT to start printing.

window.QuickBox
Click on PRINT or type RETURN to send the file to the printer.
If this does not work for your printer then change the CR/LF DIP switch OR:
Load the printer driver and save the file onto it.

window.QuitBox
Click QUIT     (or press Q) to leave Zap *without* saving any files.
Click TO FRONT (or press T or F) to bring the unsaved data to the front.
Click CANCEL   (or press C) to cancel this dialogue.

window.ReplaceBox
Type search string then RETURN.
Type replace string then RETURN.
Press CTRL U to clear a buffer.
Press ctrl-letter keys to alter the options.

window.SaveBox
Drag the file type icon to a directory window to save the file.
Press RETURN or click on OK to save the file.
Click ADJUST on OK to save the file but leave the window open.
Click MENU to bring up a file type menu.

window.SaveOBox
Click on OVERWRITE (or press O) to replace the file on disc.
Click TO FRONT (or press T or F) to bring the existing file to the front.

window.SaveCBox
Click on SAVE TO CSD to save to the currently selected directory.

window.SaveSCBox
Click on SAVE TO CSD to save the selection to the currently selected
directory.

window.SaveSelBox
Drag the file type icon to a directory window to save the selection.

window.SearchBox
Type the search string and press RETURN to search for it.
Click on 'Edit Macros' to change the search macros.
Press TAB to recall the old search string.
Press ctrl-letter keys to alter the options.

window.UndoBox
Zap is asking if you want to turn off the UNDO buffer for a file.
If you do turn it off, remember that PASTE and YANK will no longer work.

window.WCBox
This is the Zap's word count window.
It displays the number of words in the file.

| ***************************************************************
| *                       C O M M A N D S			*
| ***************************************************************

ALLWINDOWS <string>
Executes the supplied colon-separated string of zap commands once for each
valid Zap window.  The cursor is set up in each window before the command is
called.

ALLMODES <string>
Executes the supplied colon-separated string of zap commands once for each
loaded mode.  The command is executed as though from the icon bar icon.
This happens even if the command has been issued from the minibuffer.
Commands which change options therefore affect the default options for the
mode.  The command is mainly intended to allow options which are normally set
up on a per mode basis to be set for all loaded modes.  Unfortunately there
is no simple way to use the command from Zap's front end at the moment.

ALTERSEL (Martin Ebourne)
Move the closest end of the selection to the current cursor position (like
Adjust). If there is no selection then select the next character.

ASYOUTYPE
Toggles the 'Spell-as-you-Type option' for the mode.

AUTOINDENT
Toggles auto indent on and off.
(acts like WFLAGS_TOGGLE 16)

AUTOSOFTWRAP
This controls the setting of the auto soft wrap detection.
If set, then when a suitable file is loaded, it is scanned for long lines.
If these are found, then soft-wrap is engaged.
Auto soft wrap detection is turned on by default.

BASEMAP <word>
This command switches the key basemap to the given keymap number.
All further keypresses will use this keymap.
(It writes to w_basemap, w_currentmap and w_helpmap - see E-Windows)

BASEMAPLIST
Internally used to generate the keymaps menu for basemap selection.

BASEMAPN <string>
This command switches the key basemap to the named keymap.
All further keypresses will use this keymap.
(It translates the name to a number then calls BASEMAP.)

BEEP
Makes a short beep.
(Does a VDU 7)

BINDTOKEY <string>
Evaluates string to a number and binds the currently learnt sequence
to that key code. (eg BINDTOKEY "&1B").
If <string> is not given then prompts you to press a key.

BITMAPFONT <string>
This simply sets the bitmap font in the relevant window to be sourced from
the file specified by "ZapFont:<string>".  To force the font to change, it
should be followed by a FONTTYPE 1 command.

BITMAPLIST
For internal use.
Generates the menu of bitmap fonts.

BREAK
Breaks out of a REPEAT or WHILE loop or a CASE block.

BYTE_CONTROLREPLACE <string>
Sets the Byte mode control character replacement to the first character of
<string>.

BYTE_FLAGSTOGGLE <word>
Used internally to set the Byte mode options.

BYTE_GROUPSIZE
Sets the Byte mode group size. Values in the range 0-15 are allowed.

CANCEL
Cancel current Yank and Search-as-you-type operations.
Cursor is restored to its original position.

CASE <string>
The start of a CASE block.
 
<string> is a Zap expression (see IF). It is compared against the expressions
listed in each WHEN.
 
Normal usage looks like
	CASE <expression>:
	WHEN <list of expressions>:<command(s)>:
	WHEN <list of expressions>:<command(s)>:
	...
	DEFAULT:<command(s)>:
	ENDCASE
(You may use CWHEN instead of WHEN.)
 
See also CWHEN, WHEN, DEFAULT, ENDCASE.

CDOWN
Moves cursor to the end of the file.
A marker is left at you previous position.
(Use sF6 to restore your position).

CHAR <byte>
Inserts the character code <byte> into the file.
Multiple presses are buffered (as with any byte call).
(Uses mode entry point e_char)

CLEARSEL
Clears any selected regions.
(Calls Zap_ClearSel)

CLEARGC
Deletes the global clipboard, if it is owned by Zap.

CLEFT
Moves cursor to start of line.
(uses mode entry point e_cminus)

CLI <string>
Execute <string> as a command line interpreter command. Eg CLI "Set A 3".
Output from the command is redirected to Null:.
See also OSCLI and WIMPTASK.

CLOSEOTHER
Closes the next window in the swap-window sequence.
(Closes other window if only two are open)

CLOSEPRINTER
Closes 'printer:$' filer window via *Filer_CloseDir.

CLOSEWINDOW
Closes the current window.
Puts the cursor in the next available window afterwards.

CODE_FLAGSTOGGLE <word>
Used internally to set the Code mode options.
There is a close correspondence between the way the bits are used here and
the use in the 'Debugger' module.

COLONSEPARATOR
Toggles whether the colon separator between the line number and the body of 
the text is present (acts like WINFO_TOGGLE 3).

COLOURLIST
Internally used command to create the COLOURLIST menu.

COLUMNTAB
Set tab mode to column tab.
(Changes b9-10 of w_flags)

COMMAND <string>
Executes the command (or colon separated list of commands) <string>.
(Uses Zap_CommandString)

COMPILE
In BASIC mode saves the program to disc and then runs it.
In C mode compiles the program.
If running the program and chaining it are functionally equivalent then
COMPILE should attempt to RUN the program in a task window.
(Calls the mode entry point e_compile)

CONFINEHORIZONTALLY
Toggles the 'confine horizontally' cursor option.  If set then cursor-right
will move immediately to the start of the following line if it goes off the
previous one.

CONFINEVERTICALLY
Toggles the 'confine vertically' cursor option.  If set then cursor-up and
down are confined so that the cursor is always near editable characters,
and never in 'free space'. The preferred column of the cursor is remembered,
and restored as nearly as possible on any further up or down movements.

This option mimics the behaviour of editors which do not allow the cursor to
move away from the text.

CONTINUE
Jumps to the next UNTIL, ENDWHILE or ENDCASE.

COPY
Initiates split-cursor-copying mode.
Each subsequent press copies a single character.
(Switches cursor to mode 2 and uses mode entry point e_copy)

COPYSEL
Copies the selected region to input caret position.

COREDUMP
Produces an image of Zap's memory in Zap's directory.
Use to produce a record of a nasty bug etc.

CREATEFILE <word>
Creates an empty file of filetype <word>.

CRIGHT
Moves to end of line using.
(uses the mode entry point e_cminus)

CUP
Moves to the start of a file, leaving a marker at the old offset.

CURSORMENU
Internally used to produce the cursor types menu.

CUT
Deletes the selected region.
If the undo buffer is on, it can be pasted back with cY (Paste).
If the undo buffer is off, then it's gone for ever!

CWHEN <string>
Part of a CASE block.
 
CWHEN provides C-like fallthrough; if the immediately preceding CWHEN/WHEN
block contained a matching expression, then this will be treated as if it
does also. If you want BASIC-like behaviour, use WHEN instead.
 
<string> is a comma-separated list of Zap expressions (see IF).
 
If the CASE expression matches one of these expressions, then the commands up
until the next CWHEN, WHEN, DEFAULT or ENDCASE are executed, and the commands
following DEFAULT will not be executed.
 
A CASE expression may be matched in more than one CWHEN or WHEN, unlike BASIC
where only the first matching WHEN counts.

DATE <string>
Inserts a date string of format <string>.
Eg, <string>=%MI to substitute the time in minutes.
(uses OS_ConvertDateAndTime)

DEFAULT
Part of a CASE block.
 
The commands following this are executed only if there was no matching WHEN.

DEFAULTMAP
In a window, changes the key basemap to the mode's default value.
 
From the iconbar menu, changes the mode's basemap to the global basemap, as
defined in the Keys file.
 
If the keymap doesn't exist, then it will fall back on the global basemap
then on keymap 0.

DELETE <string>
If no string is supplied the command deletes the character before the cursor.
(calls mode entry point e_delete with R7=0)
If the string is in the following table (case senstive) table then the
associated action is taken:
 
String		Equivalent  	Description
 
"PREV"		DELETE		Deletes the previous character.
"NEXT"		DELETENEXT	Deletes the next character.
"WORDSTART"	DELWORDSTART	Deletes the previous word.
"WORDEND"	DELWORDEND	Deletes the next word.
"WORD"				Deletes the entire word under the cursor.
"LINESTART"	DELTOSTART	Deletes to the start of the line.
"LINEEND"	DELTOEND	Deletes to the end of the line.
"LINE"		DELLINE		Deletes the entire line.
"FILESTART"			Deletes to the start of the file.
"FILEEND"			Deletes to the end of the file.
"FILE"				Deletes all the text in the file.
"SEL"		CUT		Deletes the selection.
"NONSEL"			Deletes everything except the selection.
 
The selection is maintained wherever possible.

DELETENEXT
Deletes the character under the cursor.  Copies a single character if in
'copy' mode.
(calls mode entry point e_delete with R7=1)

DELETENEXTNOCOPY
Deletes the character under the cursor much like DELETENEXT.

DELLINE
Deletes the line the cursor is on.
Cumulative deletes can be pasted in one go by cY.
(uses e_lineprev and e_linenext to find the line limits)

DELTOEND
Deletes from cursor to the end of the line.
Deletes the line terminator if the cursor is at the line end.
(uses e_lineend to find the line end)

DELTOSTART
Deletes from cursor to the start of the line.
(uses e_linestart to find the line start)

DELWORDEND
Deletes from the cursor position to the end of the word.

DELWORDSTART
Deletes from the cursor position to the start of the word.

DISCARDFILE
Kills a file and all windows on that file without prompting the user.

DISCARDWINDOW
Kills a window, and the file if auto-delete is on and this is the last
window on that file - without prompting user.

DOWN
Moves cursor down a line.

DROPMARK
Drops a marker at the current location, unless there is already one there.
See also TOGGLEMARK.

DUMPFILE
Creates a text image of the current display for this file.

DZAPBOX
Opens the 'read disc' window.

EDITBYTE <string>
Assembles the instruction given by <string>.
The lowest byte of te result is placed at the current cursor position.
This command calls operates in a similar manner to the EDITWORD command
and it too uses the ASSEMBLE command internally.

EDITWORD <string>
Assembles the instruction given by <string>.
Places it at the current cursor position (using its file address).
This command calls the ASSEMBLE command.  It differs from it in that the
minibuffer prompt always offers a DCD as the object to be edited.

ELSE
Optional part of an IF block.
Because ELSE does no more than invert the condition result, you may use
several in one IF block, although this isn't recommended.

EMACS
Switches to Emacs key map emulation.
(Uses BASEMAPN "Emacs")

ENDCASE
The end of a CASE block. Required, though at the end of a command string, an
ENDCASE is implied for each unterminated CASE.

ENDIF
The end of an IF...ELSE...ENDIF block. Required, though at the end of a
command string, an ENDIF is implied for each unterminated IF.

ENDWHILE <string>
The end of a WHILE...ENDWHILE loop. Required, though at the end of a command
string, an ENDWHILE and false condition is implied for each unterminated
WHILE.

ESCAPE
Cancels the following modes (leaving cursor where it is):
copy-mode, yank-mode, select-via-cursor, search-as-you-type.
See also Cancel (cG).

EXECUTE
Execute last learnt sequence.
(see cL)

FASTUNDO
Undo the last operation taking the fastest route in the undo tree.
For example if you do A,B,UNDO,C,FASTUNDO,FASTUNDO then it will
delete the 'a' as opposed to inserting the 'b'.

FFLAGS_TOGGLE <word> 
General purpose command to toggle one bit of the file flags word.
The titlebar updated afterwards.
See WFLAGS_TOGGLE for details of <word>.

FINDFILE <string>
Opens a buffer on the indicated file (should be a full path name).

FINDFILEREADONLY <string>
As for FINDFILE but puts in read only mode when file loaded.

FINDFUNCTION
This examines the text under the cursor and looks for the definition of any
function if finds there.
In BASIC mode it looks for a FuNction or PROCedure of the same name, or for
an assembler label, whichever it thinks is more appropriate.

FONTLIST
Internally used to produce the menu of outline fonts.

FONTSIZE <word>
Set the outline font size to <word>.

FONTTYPE <word>
Sets the display font type according to word:
0=bitmap font at 1dpp, 1=scaled bitmap font, 2=system font via vdu.
3=anti-aliased font (quick) 4=anti-aliased font (via vdu)
5=bitmap font (double height).

FORMATTEXT
Formats the current paragraph from the cursor position.
Uses the wordwrap width for formatting.

FREECLICK
Toggles the 'Free click' option. When set, if the user clicks beyond the
last character in a line, the cursor is still positioned where the click
took place, rather than being moved to the last character on the line.

FULLUNDO
Undo the last operation taking the slowest route in the undo tree.
For example if you do A,B,UNDO,C,FULLUNDO,FULLUNDO then it will insert
the 'b' as opposed to deleting the 'a'. Compare this with FASTUNDO.

GETMODULE
Internally used to open the list of modules to grab.

GETWORKSPACE
Internally used to open the list of module workspace's to grab.

GETDYNAMICAREA
Internally used to open the list of dynamic areas to grab.

GOTO
Bring up the goto dialogue box.

HELP <string>
Gives online help on subject according to the first letter of <string>.
'c'=help on a command (HELPCOM), 'f'=help on a function (HELPFN),
'k'=help on a key (HELPKEY),     'm'=help on the current mode,
'z'=Loads main help file on Zap.

HELPFN <string>
Help is given on the function <string>.

HELPKEY <string>
<string> is evaluated to a number and help is given on that key code.

HELPCOM <string>
Help is given on the command <string>.

HEXASCII
Toggle hex/ascii entry mode.
Byte mode uses this to control how data is entered.
(acts like WFLAGS_TOGGLE 5)

ICONISE
Iconises the window.

IF <string>
The start of an IF...ELSE...ENDIF block. (The ELSE part is optional.)
 
<string> is a Zap expression - evaluated by the OS's evaluation routines,
after substitution of Zap functions, which must be prefixed by '@'.
 
Normal usage looks like
	IF <condition>:<command(s)>:ENDIF
or	IF <condition>:<command(s)>:ELSE:<command(s)>:ENDIF
and a typical condition string may look like
	(@MODEN="text" OR @MODEN="email")
 
IFs may be nested.

INDENT <string>
Indents the currently selected region by the string <string>.
If the string evaluates to a number then it indents by that number of spaces.
If no string is supplied then the command uses the default string as given in
the menu option 'selection.indent'.  This may be set by using the INDENTBY
command.

INDENTBY <string>
Indents the selected area by <string>.
If <string> is a number then uses that many spaces.
If <string> is negative then outdents.
If no string is supplied then the mini-buffer is used and pressing 'Tab'
recovers the current string.

INDIRECT
Jump to the address contained at the word at the current cursor position.
(leaving a marker behind as with any jumps)

INFINITEWRAP
Used to toggle the infinite wrap option on window wrapped windows.

INFOBOX
Opens the info box.

INSERT <string>
Inserts <string> into the file.
(Uses the mode entry point e_char)

INSERTBLOCK <string>
Acts like INSERT, but its action can always be undone in one keypress.
It is equivalent to STARTOP:INSERT <string>:STOPOP

INSERTBLOCKGS <string>
Acts like INSERTGS, but its action can always be undone in one keypress.
It is equivalent to STARTOP:INSERTGS <string>:STOPOP

INSERTDATE
Insert the current date using the format in the keys file.
(variable &300)

INSERTGS <string>
Inserts <string> into the file, GS-Transing it first.
Hence, you can include control code (eg |M).
(Uses the mode entry point e_char)

INSERTTIME <string>
Insert the current time using the format string given by <string>.
If none is supplied then the default string is used.
This is set up in the 'Settings' file as variable &301.

INSTALLICON
Installs an icon bar icon if one is not already present.

JOINLINE
Joins the current line to the following line.
(uses the mode entry point e_joinline)

KEEPREGION
Copies the selected region to the yank buffer (Emacs kill ring).
The region can be pasted again using cY.
This is the equivalent of Emacs Meta-W.

KEYMAP <word>
Change the keymap to <word> for the next key press only.
After the next key press the keymap will revert to BASEMAP value.
(Eg Used for ctrl-X extensions in the Emacs key map)

KEYMAPN <string>
Change the keymap to <string> for the next key press only.
After the next key press the keymap will revert to BASEMAP value.
(It translates the name to a number then calls KEYMAP.)

LASTCYLINDER (Darren Salt)
Move to the last cylinder on an (unaltered) file read from disc.

LASTMARK
Jump to the previous mark in the marker buffer.

LASTMATCH
Move to the previous match of the current search string.
Will move across files if the 'all files' option is set.

LASTSECTOR
Move to the last sector on an (unaltered) file read from disc.

LASTTRACK
Move to the last track on a file read from disc.

LEARN
Start or stop learning a key sequence.
Use Execute (F1) to replay the learnt sequence.
NB Escape will be learnt and will not stop the learning.

LEFT
Move cursor left.
(calls mode entry point e_minus)

LINEEDIT
Toggles line edit mode on and off.
(acts like WFLAGS_TOGGLE 14)

LINENOS <word>
Change line number state of the window to <word>.
0=no line numbers 1=logical line nos 2=physical line nos 3=addresses.

LINESELECT
Toggles the 'Line selection' option.  This controls how Zap selects lines
and pastes in any selected regions more than a single line long.

LINESPACING <word>
Sets the line spacing to <word>.

LINEWRAP
Toggles line wrap mode on and off.
(acts like WFLAGS_TOGGLE 26)

LISTFNS
Lists function definitions for the given mode.
(via e_listfns)

LOADLIST
Internally used to generate a menu of modes to load.

LOADMODULE <string>
Load the module given by filename <string> as a Zap module.
Warning: This is very low level - loading a module which is
already loaded will cause a crash.

LOCALPASTE
Pastes in the most recently cut region, /ignoring/ anything in the global
clipboard that may have been cut in another application, and always using
the most recent cut made by Zap.

LOCAL <string>
Declares variables as local to the current command string. The parameter is a
comma-separated list of variable names, eg.
	LOCAL (foo,bar)
Wildcarded names may not be used.
 
The variables are *not* initialised; all that happens is that their old
values are stored ready to be restored on exit from the command string.

MAKEDEFAULT
This saves the window's options as the current default options.
Follow this by a 'save options' to make the current window dictate
the default options. Useful for setting default colours.

MARGIN <word>
Set the margin to <word>.

MENUOPEN <word> (Chris Rutter)
Opens Zap internal menu number <word>.
Note that menus with numbers greater than four may change in future
versions of Zap.
One possible use involves placing the following in the 'Settings' file:
Command executed on IB ADJUST   &30F    MENUOPEN 2

MINIMENU
Internally used to create the minibuffer options menu.

MINIMISEMEMORY
Contacts heap by as much as possible.
I'm afraid it's an Acorn OS_Heap type heap so this won't usually do much.
Automatically done whenever a file is removed from Zap.

MISCOPS <word>
Toggles a miscellaneous option according to <word>
 0=Auto removal of files when a window closes
 1=Auto clearing of selection regions when a character typed
 2=reserved
 3=Flashing cursor
 4=Check datestamp before saving a file
 5=Auto clear of search box when opened
 6=Confine cursor to visible area of the window
 7=Trap MSDOS files
 8=Autoload FlashCar
 9=Autoload LineEditor
10=Autoload Disassembler
11=Autoload Assembler
12=Autoload HidePtr
13=Autoload ZapRedraw
14=Silent operation
15=No anti-aliasing
16=Autoload IClear
17=Autoload KeyExtend
18=No horizontal scroll

MODE <word>
Change the current display mode to <word>.
Use MODEN in preference.

MODEN <string>
Change to the display mode named <string>.

MOVEBOX
Opens the box for disc reading navigation, if the file is an appropriate one.

MOVESEL
Move the selected area to current cursor offset.

MULTICOMMAND <data>
Executes a list of other commands (eg learnt sequence or ':' separated
chain of commands). The list is stored in the data block.
The data block is a -1 terminated list of entries of the form given below.
Note that all the data for the commands to be executed is stored within the
data block except for data type 4 (other multicommands).
	#0 Command address
	#4 Data length/number of times (R1 on command entry)
	#8 Command data. Depends on the type of the command (see E-command):
		0 No data
		1 List of #4 bytes then align
		2 List of #4 words
		3 0 terminated string then align
		4 Pointer to the data block 

MZAPBOX
Opens the 'read memory' window.

NEWFILE <string>
Create an empty file. The mode and filetype are dependent on the parameter
and situation; they may be specified as "<mode name> <filetype>", eg:
NEWFILE "Byte &FFD". If not specified, they are inherited from the current
mode, or taken as a default of "Text &FFF" if used from the iconbar.

NEWTYPE <word>
Changes the file type of the file to <word>.
Creates a file of value <word> if on main (options) menu.

NEWVIEW
Open a new window on this file.
(copying the old window mode and format)

NEWVIEWLIST
Internally used to create the menu of files to open a new view on.

NEXTCYLINDER (Darren Salt)
Move to the next cylinder on an (unaltered) file read from disc.

NEXTMARK
Jump to next mark in the marker buffer.

NEXTMATCH
Move to the next match of the current search string.

NEXTSECTOR
Move to the next sector on a file read from disc.

NEXTTRACK
Move to the next track on a file read from disc.

NONSTANDARD
Toggles non standard editing on and off.
(acts like WFORMAT_TOGGLE 15).

NULL
Does nothing.
(but prevents the key from being passed on via Wimp_ProcessKey)

OPENPARENT
Open the directory containing the current file.

OPENPRINTER
Open a filer window on printer:$ via *Filer_OpenDir.

OSCLI <string>
Execute <string> via the command line interpreter. Eg OSCLI "Help".
Command output is sent indirected to <Wimp$Scrap>.
The file is displayed if it's non null. See also CLI and WIMPTASK.

OUTDENT
Outdents the selected region.
(by the length of the current indent string)

OUTLINEFONT <string>
<string> is a fontname, optionally preceeded by a '#' character.  If
present, the hash prevents the font from being installed and cached - useful
when preventing a second attempt to cache the font when used in conjunction
with the FONTSIZE command.

PASTE
Pastes the last cut region repeatedly.
(Use YANK to cycle through previously deleted regions)

PASSTHROUGH <key>
In TaskWindow mode, passes the WIMP key number, suitably translated, through
to the task, eg. PASSTHROUGH &19B for sCopy.

PRINTFILE
Open the fancy print window.

QUICKPRINT
Open the quick print window.

QUICKSAVE
Save the file directly to disc with no prompt.

QUIT
Kill Zap - dead!
(prompts user to save altered files first)

QUOTE
Causes the next key typed to have its key code entered into the text.
It is the Zap key code that is entered.
Hence you need to do cQ cSpace to get a 0.

READONLY
Toggle the read only state of a file.
(b8 of f_flags)

REDO
Redo the last undone operation whether full or fast.

RELOADKEYS
Reload the 'keys' file, reading the new key bindings.

REMOVELIST
Internally used to produce the menu of files to remove.

RENUMBER
In BASIC mode this renumbers the program
(In general calls the mode entry point e_renumber)

REPEAT
The start of a REPEAT...UNTIL loop; the loop is executed at least once. The
loop is only learnt once, if learn mode is enabled.
 
Normal usage looks like
	REPEAT:<command(s)>:UNTIL <condition>
 
REPEATs may be nested.

WARNING: Infinite loops are very easy to get into. For this reason,
Alt-Escape is provided as a quick escape mechanism.

REPLACE
Open the Search & Replace window.

RETURN
Breaks the line (if not in line edit mode), indenting in auto-indent mode.
Also cancels split cursor copying.
(uses mode entry point e_return)

RETURNCHAR <word>
Set the value of the file return character.

RETURNNOINDENT
Breaks the line as for RETURN but does not indent in auto-indent mode.

RIGHT
Move cursor right.
(using mode entry point e_plus)

RUN
In BASIC mode this runs the BASIC program at PAGE.
(in general calls the mode entry point e_run)

RUNANDQUIT
In BASIC mode this runs the BASIC program at PAGE and then quits BASIC.
(in general calls the mode entry point e_runandquit)

SAVE
Opens the save box.

SAVEANDRUN
In BASIC mode this saves the program to disc and then chains it.
(in general calls the mode entry point e_saveandrun)

SAVEFILE <string>
Save the current buffer with filename <string>.
If <string> is omitted the buffer is saved under its current name.
(unless it doesn't have a proper name when you are prompted for one)

SAVEOPTIONS
Saves the current default options to the !Config file.

SAVESEL
Opens the save selection box.

SCDOWN
Move down display one line (without moving cursor).

SCLEFT
Move to left of display one character (without moving cursor).

SCRIGHT
Move to right of display one character (without moving cursor).

SCUP
Move up display one line (without moving cursor).

SDOWN
Move down a page.

SEARCHBACK <string>
Search as you type backwards (if no arguments).
Searches backwards for <string> if argument given.
Cursor is placed at the end of the match.

SEARCHBUF <string>
Open Search window with output to window option set (if no arguments).
Produce a buffer containing all matches of <string> if argument given.

SEARCHCUR <string>
Open Search window with output to cursor option set (if no arguments).
Move cursor to the first match of <string> if argument given.

SEARCHFORWARD <string>
Search as you type forwards (if no arguments).
Searches forwards for <string> if argument given.
Cursor is placed at the end of the match.

SELECTBUFFER
Select the entire buffer.

SELECTLINE
Select the line which the cursor is on.

SELREGION
Start selection of region by cursor movement.
Use Escape to end the selection.
(this sets the cursor mode to 4)

SENDSEL <string>
This sends the selected text into the keyboard buffer, a character at a time.
It may be aborted by pressing the ESCAPE key.
If <string> is "X" then no control characters are sent.
Only one selection at a time may be in the process of being sent.

SET <string>
Sets a Zap variable to the result of a Zap expression.
Usage:   SET (variable=expression)
Example: SET (foo="string")
	 SET (foo=12)
	 SET (bar=@CHAR)

Within an expression:
 
To use a variable, prefix it with "@$" (string) or "@#" (number).
Example: INSERT $(@$foo)
 
To evaluate a variable as an expression, prefix it with "@=".
Example: CHAR #(@=bar)

SETMARGINWIDTH
Sets up the width of the line numbers which may be used in the mode.
Only settings from one to eight are allowed.

SETWIDTH <string>
Set width of window to number contained in <string>.
(calls mode entry point e_setwidth)

SLEFT
Move cursor back a word.
(calls e_sminus)

SOFTWRAP
Sets up the various flags to toggle the state of the window's soft wrap
state and redraw the screen if necessary.

SPLITLINE
Split line at current cursor position.
(calls mode entry point e_splitline)

SRIGHT
Move cursor forward a word.
(calls e_splus)

STARTOP
Starts an intensive Zap operation.  This turns on the hourglass and ensures
that the subsequent group of commands will be able to be undone in a single
step.

STARTADDR <word>
Set apparent start address of file to <word>.
(this address is used in the margin in byte/code mode)

STARTLINE <word>
Set the apparent line number of the first line in the file.

STILLDOWN
Combines the action of DOWN and SCDOWN, i.e. moves the cursor down one line
whilst maintaining it's vertical position in the window.

STILLUP
Combines the action of UP and SCUP, i.e. moves the cursor up one line
whilst maintaining it's vertical position in the window.

STOPOP
Stops an intensive Zap operation - this should always follow any
calls to the STARTOP command.

STRIPSPACES <word>
Perform space altering commands according to the bits set in <word>.
b0=Strip spaces at the end of lines, b1=Strip tabs at the end of lines
b2=Tabify (ie convert spaces to tabs), b3+ reserved

SUP
Move up a page.

SUSPEND
Brings up the command line (same as F12).

SWAPCHARS
Swap characters either side of cursor.

SWAPWINDOW
Moves cursor to the next window in sequence.
If several views are on the file then swaps between views.

SWITCHTAB
This toggles the TAB mode for a file between UNIX and Truetab modes.
(b9-b10 of w_flags)

TAB
Performs the mode's tab action.
(calls e_tab)

TABCHAR <word>
Sets the current tab character.  This is usually 9.

TABDISPLAY <word>
Sets the way tabs are displayed according to <word>:
0=none 1=as spaces 2=arrow 3=dashes then arrow.

TABMODE <word>
Sets the current tab insertion mode according to <word>:
0=unix tab 1=edit tab 2=column tab.

TABSASSPACES
Toggles whether tabs are inserted as spaces or truetabs (char 9).
(acts like WFLAGS_TOGGLE 11).

TOBACK
Moves the window to the back of the window stack.
(via Zap_OpenWindow 4)

TOFRONT
Moves the window to the front of the window stack.
(via Zap_OpenWindow 3)

TOGGLEHEX
Toggle hex/decimal display of line numbers.
(b10 of w_format)

TOGGLEINSERT
Toggle insert/overwrite modes
(acts like WFLAGS_TOGGLE 1).

TOGGLEMARK
Insert/delete mark from marker buffer at current cursor offset.

TOGGLEUNDO
Toggle the undo buffer for a file on and off.

TOGGLEWIND
Toggles the window size.
(he not-fully-open size is stored in w_togminx to w_togmaxy)

UNIVERSALARG <string>
Evaluates <string> to a number and then passes it to the next command.
This usually has the effect of executing the next command <string> times.

UNSET <string>
Unsets one or more Zap variables.
Usage:   UNSET (<variable name>)
Example: UNSET (foo)
	 UNSET (b#r)
	 UNSET (q*x)
	 UNSET (*)

UNTIL <string>
The end of a REPEAT...UNTIL loop. Required, though at the end of a command
string, an UNTIL (1) is implied for each unterminated REPEAT.
 
<string> is a Zap expression (see IF).
 
A typical condition string may look like
	(@CHARSTR="\n")

UP
Move cursor up a line.

UPDATEWINDOW
Redraws the contents of the window it is issued from.  It maintains the
position of any cursors and the current selection.

WFLAGS_ALTER <word>
Command to alter bits of the w_flags or opt_flags word.
The window is redrawn afterwards to display the new status.
The <word> is as for WFLAGS_TOGGLE.

WC (Elliott Hughes)
WC counts the number of words in a file. If called as a command, it opens a
window containing the number of words, centred on the pointer. If attached
to a menu, it provides the same window as usual, but as a submenu. The
method used for counting words is (as far as I can tell) the same as that
used by Impression Publisher: it's not terribly accurate, but it's pretty
nippy.  (The name, rather than being an obscure reference to a toilet, is
that of the UNIX utility that counts words.)

WCSEL (Elliott Hughes)
The "WCSEL" command counts the number of words in the current selection.
It acts much like the WC command.

WFLAGS_TOGGLE <word>
Command to alter bits of the w_flags or opt_flags word.
The titlebar is updated after the toggle.
The <word> is a short 'program' consisting of up to 4 instructions in
the 4 bytes. Each byte has the form:
 b0-b4 = bit to effect
 b5-b6 = 0=> toggle the bit, 1=> set the bit, 2=> clear the bit
 b7    = 1 to show this byte is active (in the top 3 bytes only)
Eg, &5 means 'toggle bit 5'
Eg, &8609 means toggle bit 9 then toggle bit 6 etc.

WFORMAT_ALTER <word>
Command to alter bits of the w_format or opt_format words.
The titlebar is updated afterwards but the window not redraw.
The <word> is as for WFLAGS_TOGGLE.

WFORMAT_TOGGLE <word>
Command to alter bits of the w_format or opt_format words.
The window is redrawn afterwards to display the new status.
The <word> is as for WFLAGS_TOGGLE.

WHEN <string>
Part of a CASE block.
 
WHEN provides BASIC-like lack of fallthrough. If you want C-like fallthrough,
use CWHEN instead.
 
<string> is a comma-separated list of Zap expressions (see IF).
 
If the CASE expression matches one of these expressions, then the commands up
until the next CWHEN, WHEN, DEFAULT or ENDCASE are executed, and the commands
following DEFAULT will not be executed.
 
A CASE expression may be matched in more than one CWHEN or WHEN, unlike BASIC
where only the first matching WHEN counts.

WHILE <string>
The start of a WHILE...ENDWHILE loop. The loop is only learnt once, if learn
mode is enabled.
 
<string> is a Zap expression (see IF).
 
Normal usage looks like
	WHILE <condition>:<command(s)>:ENDWHILE
and a typical condition string may look like
	(@MODEN="text" OR @MODEN="email")

WHILEs may be nested.

WARNING: Infinite loops are very easy to get into. For this reason,
Alt-Escape is provided as a quick escape mechanism.

WIMPTASK <string>
Execute <string> as an OSCLI command via Wimp_StartTask.
Differs from OSCLI and CLI in that VDU output is not redirected.
Should be used for starting up other applications.

WINDOWWRAP
Sets up the various flags to toggle the state of the window wrap and
redraw the screen if necessary.

WINFO_ALTER <word>
Command to alter bits of the w_info or opt_info words.
The titlebar is updated afterwards but the window not redraw.
The <word> is as for WFLAGS_TOGGLE.

WINFO_TOGGLE <word>
Command to toggle bits of the w_info or opt_info words.
The <word> is as for WFLAGS_TOGGLE.

WORDWRAP
Toggle wordwrap mode on/off.
(acts like WFLAGS_TOGGLE 13).

WORD_CONTROLREPLACE <string>
Sets the Word mode control character replacement to the first character of
<string>.

WORD_FLAGSTOGGLE <word>
Used internally to set the Word mode options.

WORD_GROUPSIZE
Sets the Word mode group size. Values in the range 0-15 are allowed.

WRAPWIDTH <word>
Set the wordwrap width.

WRITEFILE <string>
Saves the buffer with filename <string>.
If <string> is not given then it prompts for a filename.
(it differs from Savefile which doesn't usually prompt)

YANK
Paste last cut region from undo buffer to current cursor position.
On repeated action it pastes previously cut regions in a cyclic manor.

| Zap builtin functions

@ADJUST
Returns TRUE if Adjust is being pressed.

@ALT
Returns TRUE if either Alt key is pressed, FALSE otherwise.

@BASEMAP
Returns the current basemap number.

@BASEMAPN
Returns the current basemap name, or null if it has no name.

@BUTTONS
Returns the last mouse buttons state (Wimp_GetPointerState).

@CHAR
Returns the character at the cursor.
255 is returned if the cursor is at the end of the file.

@CHAROFF <offset>
Returns the character at (cursor+offset).
255 is returned if the character is outside the file.

@CHARSTR
Returns the character at the cursor as a string.
An empty string is returned if the cursor is at the end of the file.

@CHAROFFSTR <offset>
Returns the character at (cursor+offset).
An empty string is returned if the character is outside the file.

@COPY
Returns true if the copy cursor is active.

@CTRL
Returns TRUE if either Ctrl key is pressed, FALSE otherwise.

@EOF
Returns TRUE if the cursor is at the end of the file.

@FALSE
Returns 0.

@FILENAME
Returns the name of the file.

@GREYED <command>
Returns TRUE if the Zap command <command> would be ticked in a menu.

@IN <string>
Array lookup: returns TRUE if the first element is the same as one of the
later elements. The elements in the string are comma-separated; each is
evaluated as a Zap expression (see IF). All elements must be of the same
type.
 
Examples of usage:
 
Command:	IF (@IN(@MODEN,"basic","code")=@TRUE):UPDATEWINDOW:ENDIF
Equivalent to:	IF (@MODEN="basic" OR @MODEN="code"):UPDATEWINDOW:ENDIF
Action:		Redraw the window if not in BASIC or Code modes
 
Command:	IF (@IN(@CHAR,@TABCHAR,32)):RIGHT:ENDIF
Equivalent to:	IF (@CHAR=@TABCHAR OR @CHAR=32):RIGHT:ENDIF
Action:		Move the cursor right if it's on a tab or a space

@KEYMAP
Returns the current keymap number.

@KEYMAPN
Returns the current keymap name, or null if it has no name.

@MENU
Returns TRUE if Menu is being pressed.

@MODE
Returns the current mode number.

@MODEN
Returns the current mode name, converted to lower case.

@MODET
Returns the mode type.
        0 binary (Byte, Word, ASCII)
        1 Code
        2 BASIC
        3 TaskWindow
        4 Throwback
    Other Text-based

@MODIFIED
Returns TRUE if the file is modified.

@MODIFIERS
Returns a value indicating which of the modifier keys are pressed.
Bit 0 set if either Shift is pressed
Bit 1 set if either Ctrl is pressed
Bit 2 set if either Alt is pressed

@SELANYWHERE
Returns TRUE if there is a selection.

@RETURNCHAR
Returns the value of the return character in the mode.

@SELECT
Returns TRUE if Select is being pressed.

@SELHERE
Returns TRUE if there is a selection in the current window.

@SELSIZE
Returns the selection size, or TRUE if no selection.

@SHIFT
Returns TRUE if either Shift key is pressed, FALSE otherwise.

@SOF
Returns TRUE if the cursor is at the start of the file.

@STARTADDR
Returns the apparent start address of the file.

@STARTLINE
Returns the apparent line number of the first line in the file.

@TABCHAR
Returns the value of the tab character in the mode.

@TICKED <command>
Returns TRUE if the Zap command <command> would be ticked in a menu.

@TRUE
Returns -1.
