Atari XL 用户手册

下载
页码 77
The Last Word 3.0 Reference Manual 
 
7-40 
 
 
7.2  RUNNING MACROS 
 
Macros are executed in one of three ways: 
 
  Pressing <ESCAPE>, then the key the macro is attached to. 
 
  Holding down <Option> then pressing the keystroke the macro is attached to. 
 
  Pressing the key combination the macro is attached to. 
 
An important change has been implemented in LW 3.0 regarding macros. In response 
to requests from several users to be able to enter <CTRL+KEY> characters into the 
editor without pressing <CTRL+Escape> first, keystrokes are now scanned against 
macro definitions BEFORE they are scanned against the list of internal commands. 
This means you can now write a macro which totally supersedes a built-in command. 
You can, for example, attach a macro to the <CTRL+L> keystroke, and this macro will 
override the “Load” command. Note that the load command will be completely lost 
unless you implement a way of calling the <CTRL+L> command in another way. The 
only way you can now override a macro which replaces an internal command and get 
the internal command back from the keyboard is by holding down <Option> while 
typing the command keystroke. 
 
There is one other special macro keystroke: 
 
<Start> 
Pressed on its own will run the <#> macro, should one exist. This 
is another throwback to TextPro. However, in LW, use of the Start 
key has been augmented. Holding down <Start> while pressing 
another key combination will by-pass macro scanning. This 
means you can selectively run the underlying built-in command, 
even if its keystroke has been “stolen” by a macro definition. 
 
The way <Escape> triggers macros is one of the reasons <CTRL+ESCAPE> or 
<SHIFT+ESCAPE> is necessary to enter control characters in the editor and input 
dialogues. Another reason is that I wanted to make <ESCAPE> an abort key at all 
other times. 
 
7.2.1  AUTORUN MACROS 
 
LW has two kinds of “autorun” macros: The Startup macro and the Autoexec macro. 
The 
Startup macro is attached to the “@” key and is only run when LW first loads: 
therefore, the “&” needs to be defined in LW.MAC. 
 
The second kind of autorun macro is the autoexec macro, which is should be defined 
on the “&” key. This macro is run when a macro is loaded during an editing session 
with the <SHIFT+CTRL+M> command.  Note that the autoexec macro will not be run 
in LW.MAC when it is loaded at startup (the startup macro is run instead); if LW.MAC 
is re-loaded later in an editing session, however, the autoexec macro (&) will be run 
instead of the startup macro.