home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Pascal / BPASCAL.700 / D12 / DOC.ZIP / TEMC.DOC < prev    next >
Encoding:
Text File  |  1992-10-01  |  31.0 KB  |  712 lines

  1. ===========================================================================
  2. ===========================================================================
  3.  
  4.                              TEMC.DOC
  5.  
  6. ===========================================================================
  7. Turbo Editor macros
  8. ===========================================================================
  9.  
  10.           TEMC.EXE is an editor macro compiler for the IDE. It
  11.           processes a script file that defines editor macros and
  12.           key bindings, and produces a configuration file that is
  13.           read by the IDE to define the effects of keyboard
  14.           commands in the editor.
  15.  
  16.           For the Windows IDE, the file TPWALT.TEM contains the
  17.           built-in Alternate mode macro definitions and key bindings.
  18.           For the DOS and protected-mode IDEs, the file DEFAULTS.TEM
  19.           contains the built-in editor macro definitions and key
  20.           bindings. These files serve as example scripts and as bases
  21.           from which to customize the editors. Several other .TEM files
  22.           are also provided for your convenience.
  23.  
  24. ===========================================================================
  25. TEMC command line
  26. ===========================================================================
  27.  
  28.           TEMC is invoked from the DOS command line. Type
  29.  
  30.               temc [-c] <script file>[.TEM] <config file><.CMD> or <.TP>
  31.  
  32.           The script file extension is .TEM if not specified
  33.           otherwise. The default configuration file extension
  34.           is .CMD.
  35.  
  36.           The configuration file need not exist. If it does not
  37.           exist, it is created. The optional -c switch can also
  38.           be specified as /c, and can appear in any argument
  39.           position on the command line. If you use this option,
  40.           any existing command table in your configuration file
  41.           is thrown away before TEMC processes the script file.
  42.           When -c is not used, the key bindings in the script
  43.           file are merged with those already defined in the
  44.           configuration file.
  45.  
  46.           For the Windows IDE, TEMC modifies the commands used by
  47.           the IDE when the Alternate command set is specified in
  48.           Options|Environment|Preferences. You can use TPWALT.TEM
  49.           to re-create exactly the default settings of the Alternate
  50.           command set. This file is included as both a sample script
  51.           file and as the default command table. You can copy it and
  52.           modify it for your own use.
  53.  
  54.           For the DOS and protected-mode IDEs, you can use DEFAULTS.TEM
  55.           to re-create exactly the default settings of the editor
  56.           command set. This file is included as both a sample script
  57.           file and as the default command table. You can copy it and
  58.           modify it for your own use.
  59.  
  60. ===========================================================================
  61. Syntax
  62. ===========================================================================
  63.  
  64.           The syntax to define a macro is
  65.  
  66.               MACRO <macroname>
  67.                 <command1>;
  68.                 [ <command2>; ... ]
  69.               END;
  70.  
  71.           <macroname> can consist of anything that is a legal C
  72.           symbol, and <command> can be either the name of another
  73.           predefined macro or a predefined TEMC editor command. A
  74.           list of editor commands and what they do follows.
  75.  
  76.           When you define your macro, the following points are
  77.           valid:
  78.  
  79.           1. A statement defines either a named macro or a key
  80.              binding.
  81.  
  82.           2. Spaces and new lines are optional.
  83.  
  84.           3. Comments are in C-style /* ... */ pairs.
  85.  
  86.           4. Unlike C, TEMC's language is case insensitive.
  87.  
  88.           5. Some of the predefined editor commands have a syntax
  89.              that looks like a C function call with one argument.
  90.              For example,
  91.  
  92.                  SetMark(5);
  93.  
  94.              Depending on the command, the argument is either a
  95.              decimal integer constant, a character constant, or a
  96.              string literal. All are specified using C syntax.
  97.  
  98.           Here's an example of a macro definition from
  99.           DEFAULTS.TEM:
  100.  
  101.               MACRO MacScrollUp
  102.                 ScrollScreenUp; FixCursorPos;
  103.               END;
  104.  
  105.           The syntax to define a key binding is
  106.  
  107.               <key-sequence>: <command>;
  108.  
  109.              or
  110.  
  111.               <key-sequence>: BEGIN <command1>; [ <command2>; ... ]
  112.               END;
  113.  
  114.           The <key-sequence> is either a key (a character
  115.           optionally preceded by Ctrl or Alt), or a series of
  116.           keys separated by a plus sign (+). Note that the
  117.           specification of the key characters themselves is case
  118.           sensitive. For example, Ctrl+k B is different than
  119.           Ctrl+k b, even though the latter is the same as Ctrl+K b.
  120.  
  121.           White space is allowed between the key-sequence and the
  122.           colon, and each <command> can be either the name of a
  123.           previously defined macro, or one of the predefined
  124.           editor commands listed in Table 1.1.
  125.  
  126. ===========================================================================
  127. Key codes
  128. ===========================================================================
  129.  
  130.           The IDE editor makes use of an extended character set
  131.           that includes key combinations not normally available
  132.           to DOS programs. Key codes can be specified in a script
  133.           through any combination of the symbols "Ctrl+", "Shift+",
  134.           "Alt+" and a character.
  135.  
  136.           Some keys cannot be entered directly into a TEMC
  137.           script. Those keys can be referred to by their names,
  138.           as described in the following table.
  139.  
  140.           Any key in a sequence--except the first key--can be
  141.           preceded by one of the characters ^ or @. The caret (^)
  142.           indicates that any combination of case and "Ctrl" can
  143.           be used to type the key; that is, lowercase, uppercase,
  144.           or control characters. The @ sign is used to indicate
  145.           that case is insignificant for the following character,
  146.           although "Ctrl" is not accepted. For example,
  147.  
  148.           * Ctrl+k b specifies a Ctrl+K followed by a lowercase b.
  149.  
  150.           * Ctrl+k ^b specifies a Ctrl+K followed by any of b, B,
  151.             or Ctrl+B.
  152.  
  153.           * Ctrl+k @B specifies Ctrl+K followed by either b or B.
  154.  
  155.      Named keys
  156.  
  157.           Key are specified as letters, numbers, or characters,
  158.           optionally preceded by one or more of Ctrl+, Alt+ or
  159.           Shift+. The following names specify keys that cannot be
  160.           typed as themselves in the TEMC syntax.
  161.  
  162.           -------------------------------------------------------
  163.              Key name    Notes
  164.           -------------------------------------------------------
  165.              Home
  166.              End
  167.              PgUp
  168.              PgDn
  169.              LfAr        Left arrow
  170.              RgAr        Right arrow
  171.              UpAr        Up arrow
  172.              DnAr        Down arrow
  173.              Ins
  174.              Del
  175.              Enter
  176.              Return      Same as Enter
  177.              BkSp        Backspace
  178.              Tab
  179.              BkTab       No longer available, use Shift+Tab
  180.              Esc
  181.              Star        * key on the numeric keypad
  182.              Minus       - key on the numeric keypad
  183.              Plus        + key on the numeric keypad
  184.              Space       Spacebar
  185.              PrtSc
  186.              F1 to F10   Function keys
  187.  
  188. ===========================================================================
  189. Predefined editor commands
  190. ===========================================================================
  191.  
  192.           TEMC lets you use built-in editor commands and user-
  193.           defined macros as commands within macros interchangeably
  194.           as long as you don't create any loops by having two
  195.           macros calling each other, even via intermediate macros.
  196.           Note that some commands cause an escape from the editor
  197.           to the surrounding IDE, for example, by bringing up a
  198.           dialog box. Your macro will "pause" until control returns
  199.           to the editor.
  200.  
  201.           A list of all predefined TEMC editor commands is shown
  202.           next. Commands that cause an escape from the editor
  203.           follow.
  204.  
  205.      TEMC editor commands
  206.  
  207.           -------------------------------------------------------
  208.           Command name                What the editor does
  209.           -------------------------------------------------------
  210.  
  211.           BackspaceDelete             Deletes character before
  212.                                       the cursor.
  213.  
  214.           BottomOfScreen              Moves cursor to the bottom
  215.                                       line of the current window,
  216.                                       leaving column unchanged.
  217.  
  218.           CenterFixScreenPos          Adjusts the screen display
  219.                                       to ensure the cursor is
  220.                                       visible. If any adjustment
  221.                                       is necessary, adjust the
  222.                                       display so the cursor is
  223.                                       close to being centered in
  224.                                       the window.
  225.  
  226.           CopyBlock                   If there is a valid and
  227.                                       highlighted (selected)
  228.                                       text block, then at the
  229.                                       cursor location, inserts a
  230.                                       copy of the characters that
  231.                                       are selected and makes that
  232.                                       the new selected text
  233.                                       location.
  234.  
  235.           CursorCharLeft              Moves cursor left over one
  236.                                       character. This command
  237.                                       will skip over tab
  238.                                       characters and move to the
  239.                                       end of the previous line.
  240.  
  241.           CursorCharRight             Moves cursor right over one
  242.                                       character. This  command
  243.                                       will skip over tab
  244.                                       characters and advance to
  245.                                       the beginning of the next
  246.                                       line.
  247.  
  248.           CursorDown                  Moves cursor down one row.
  249.  
  250.           CursorLeft                  Moves cursor left one
  251.                                       screen column.
  252.  
  253.           CursorRight                 Moves cursor right one
  254.                                       screen column.
  255.  
  256.           CursorSwitchedLeft          Like CursorLeft, but pays
  257.                                       attention to cursor through
  258.                                       tab option setting (see
  259.                                       SetCursorThroughTabMode).
  260.  
  261.           CursorSwitchedRight         Like CursorRight, but pays
  262.                                       attention to cursor
  263.                                       through tab option setting
  264.                                       (see SetCursorThroughTabMode).
  265.  
  266.           CursorUp                    Moves cursor up one row.
  267.  
  268.           DeleteBlock                 If there is a valid and
  269.                                       highlighted (selected) text
  270.                                       block, deletes the
  271.                                       characters that are in it.
  272.  
  273.           DeleteChar                  Deletes the character at
  274.                                       the current cursor
  275.                                       location.
  276.  
  277.           DeleteLine                  Deletes the current line.
  278.  
  279.           DeleteToEOL                 Deletes all characters in
  280.                                       the current line, leaving a
  281.                                       zero-length line.
  282.  
  283.           DeleteWord                  Deletes from cursor to
  284.                                       beginning of next word.
  285.  
  286.           EndCursor                   Moves cursor to end of file
  287.                                       buffer.
  288.  
  289.           ExtendBlockBeg              Initiates a series of
  290.                                       commands that will select a
  291.                                       block of text between the
  292.                                       initial and ending
  293.                                       positions of the cursor.
  294.  
  295.           ExtendBlockEnd              Ends a series of commands
  296.                                       begun by ExtendBlockBeg.
  297.  
  298.           FixCursorPos                Ensures that the cursor
  299.                                       value specifies a row
  300.                                       between 1 and the number of
  301.                                       lines in the buffer, a
  302.                                       column greater than 0. If
  303.                                       the cursor through tab
  304.                                       option is not set, the
  305.                                       cursor is not placed in the
  306.                                       middle of a tab character
  307.                                       (see SetCursorThroughTabMode).
  308.  
  309.           FixScreenPos                Adjusts the screen display
  310.                                       to ensure the cursor is
  311.                                       visible.
  312.  
  313.           FullPaintScreen             Redraws the entire window,
  314.                                       making no assumptions about
  315.                                       what is onscreen.
  316.  
  317.           HideBlock                   Sets a flag indicating that
  318.                                       the selected text should
  319.                                       not be highlighted.
  320.  
  321.           HighlightBlock              Sets a flag indicating that
  322.                                       if the beginning and end
  323.                                       selected text markers are
  324.                                       valid, the selected text
  325.                                       should be highlighted.
  326.  
  327.           HomeCursor                  Moves cursor to beginning
  328.                                       of the file buffer.
  329.  
  330.           IndentBlock                 Inserts a space at the
  331.                                       beginning of each line in
  332.                                       the highlighted (selected)
  333.                                       text.
  334.  
  335.           InsertText                  Inserts the literal
  336.                                       "string" in the buffer at
  337.                                       the current cursor
  338.                                       location. Use the syntax
  339.                                       InsertText(string) to call
  340.                                       this command.
  341.  
  342.           LeftOfLine                  Moves cursor to beginning
  343.                                       of the current line.
  344.  
  345.           LiteralChar                 Inserts the character at
  346.                                       the current cursor
  347.                                       location, without doing any
  348.                                       special processing for
  349.                                       newline, tab characters,
  350.                                       etc. Use the syntax
  351.                                       LiteralChar(c), where c is
  352.                                       a character or integer
  353.                                       value.
  354.  
  355.           MarkBufModified             Sets a flag indicating that
  356.                                       the contents of the buffer
  357.                                       are different than what is
  358.                                       in the corresponding disk
  359.                                       file.
  360.  
  361.           MarkBufUnModified           Clears a flag, thus
  362.                                       indicating that the
  363.                                       contents of the buffer can
  364.                                       be assumed to be identical
  365.                                       to what is in the disk
  366.                                       file.
  367.  
  368.           MatchPairBackward           Same as MatchPairForward
  369.                                       except if the cursor is on
  370.                                       a ' or ", searches backward
  371.                                       for the matching character.
  372.  
  373.           MatchPairForward            If the cursor is on one of
  374.                                       the characters (, ), {, },
  375.                                       [, ], or on the first
  376.                                       character of one of the
  377.                                       pairs /* or */, searches in
  378.                                       the appropriate direction
  379.                                       for the closest instance of
  380.                                       the matching delimiter. If
  381.                                       the cursor is on the
  382.                                       character ' or ", searches
  383.                                       forward for the matching
  384.                                       character. If a match is
  385.                                       found, places the cursor
  386.                                       there.
  387.  
  388.           MoveBlock                   Like CopyBlock, but also
  389.                                       deletes the original
  390.                                       selected text.
  391.  
  392.           MoveToBlockBeg              Moves cursor to the
  393.                                       location marked as the
  394.                                       beginning of the selected
  395.                                       text.
  396.  
  397.           MoveToBlockEnd              Moves cursor to the
  398.                                       location marked as the end
  399.                                       of the selected text.
  400.  
  401.           MoveToMark                  Moves the cursor to the
  402.                                       location saved with
  403.                                       SetMark(n) command. Use the
  404.                                       syntax MoveToMark(n), where
  405.                                       n is a one-digit number, 0-9.
  406.  
  407.           MoveToPrevPos               Moves the cursor to the
  408.                                       location specified by the
  409.                                       "previous position marker."
  410.  
  411.           MoveToTempPos               Moves the cursor to the
  412.                                       saved temporary marker.
  413.  
  414.           NullCmd                     No operation. Calls the
  415.                                       editor, but performs no
  416.                                       function. Can be used to
  417.                                       cause a keystroke to have
  418.                                       no effect.
  419.  
  420.           OutdentBlock                Deletes a leading space, if
  421.                                       any, from the beginning of
  422.                                       each line in the
  423.                                       highlighted (selected)
  424.                                       text.
  425.  
  426.           PageDown                    Moves cursor down by number
  427.                                       of lines in the window.
  428.  
  429.           PageScreenDown              Scrolls screen down by
  430.                                       numer of lines in the
  431.                                       window, leaving cursor
  432.                                       position unchanged.
  433.  
  434.           PageScreenUp                Scrolls screen up by numer
  435.                                       of lines in the window,
  436.                                       leaving cursor position
  437.                                       unchanged.
  438.  
  439.           PageUp                      Moves cursor up by number
  440.                                       of lines in the window.
  441.  
  442.           PaintScreen                 Redraws the entire window,
  443.                                       assuming that the screen
  444.                                       still correctly displays
  445.                                       what the editor last drew
  446.                                       on it.
  447.  
  448.           ReDo                        Performs an Redo operation.
  449.                                       Exactly what happens
  450.                                       depends on the option
  451.                                       settings.
  452.  
  453.           RightOfLine                 Moves cursor to end of
  454.                                       current line.
  455.  
  456.           RightOfWord                 Moves cursor to the next
  457.                                       column that follows the end
  458.                                       of a word.
  459.  
  460.           ScrollScreenDown            Scrolls screen down one
  461.                                       line, leaving cursor
  462.                                       position unchanged.
  463.  
  464.           ScrollScreenUp              Scrolls screen up one line,
  465.                                       leaving cursor position
  466.                                       unchanged.
  467.  
  468.           SetAutoIndent               Sets the Auto Indent option
  469.                                       On.
  470.  
  471.           SetAutoOutdent              Sets the Backspace
  472.                                       Unindents option On.
  473.  
  474.           SetBlockBeg                 Sets the beginning of the
  475.                                       selected text to be the
  476.                                       character at the current
  477.                                       cursor location.
  478.  
  479.           SetBlockEnd                 Sets the end of the
  480.                                       selected text to be the
  481.                                       character at the current
  482.                                       cursor location.
  483.  
  484.           SetCursorThroughTabMode     Sets the Cursor Through
  485.                                       Tabs option On.
  486.  
  487.           SetInsertMode               Sets Insert/Overwrite
  488.                                       option to Insert.
  489.  
  490.           SetMark                     Sets a marker to point to
  491.                                       the character at the
  492.                                       current cursor location, so
  493.                                       a later MoveToMark(n)
  494.                                       command can restore the
  495.                                       cursor. Use the syntax
  496.                                       SetMark(n), where n is a
  497.                                       one digit number, 0-9.
  498.  
  499.           SetOptimalFillMode          Sets Optimal Fill option On.
  500.  
  501.           SetPrevPos                  Sets a marker (the previous
  502.                                       position marker) to point
  503.                                       to the character at the
  504.                                       current cursor location.
  505.                                       This marker location
  506.                                       changes only by a call to
  507.                                       SetPrevPos or SwapPrevPos.
  508.  
  509.           SetTabbingMode              Sets Use Tab Char option On.
  510.  
  511.           SetTempPos                  Saves the cursor location
  512.                                       in a temporary marker that
  513.                                       can be used by some
  514.                                       internal editor commands.
  515.                                       This is not a practical
  516.                                       application in user-defined
  517.                                       macros. Use SetMark instead.
  518.  
  519.           SmartRefreshScreen          Redraws the window,
  520.                                       skipping any portions that
  521.                                       the editor is sure are
  522.                                       unmodified since the last
  523.                                       redraw.
  524.  
  525.           SmartTab                    Inserts space or tab
  526.                                       characters in accordance
  527.                                       with the current settings
  528.                                       of the Use Tab Char option,
  529.                                       Tab Width.
  530.  
  531.           SwapPrevPos                 Exchanges the values of the
  532.                                       cursor and the "previous
  533.                                       position marker."
  534.  
  535.           ToggleAutoIndent            Toggles the state of the
  536.                                       Auto Indent option.
  537.  
  538.           ToggleAutoOutdent           Toggles the state of the
  539.                                       Backspace Unindents option.
  540.  
  541.           ToggleCursorThroughTabMode  Toggles the state of the
  542.                                       Cursor Through Tabs option.
  543.  
  544.           ToggleHideBlock             Toggles the state of the
  545.                                       highlight (selected) text
  546.                                       flag (see HighlightBlock).
  547.  
  548.           ToggleInsert                Toggles state of
  549.                                       Insert/Overwrite option.
  550.  
  551.           ToggleOptimalFillMode       Toggles state of Optimal
  552.                                       Fill option.
  553.  
  554.           ToggleTabbingMode           Toggles state of Use Tab
  555.                                       Char option.
  556.  
  557.           TopOfScreen                 Moves cursor to the top
  558.                                       line currently displayed in
  559.                                       the window, leaving column
  560.                                       unchanged.
  561.  
  562.           UnDo                        Performs an Undo operation.
  563.                                       Exactly what happens
  564.                                       depends on the option
  565.                                       settings.
  566.  
  567.           WordLeft                    Moves cursor to beginning
  568.                                       of previous word, or to end
  569.                                       of previous line, whichever
  570.                                       is first.
  571.  
  572.           WordRight                   Moves cursor to beginning
  573.                                       of next word, or to the end
  574.                                       of a line, whichever is
  575.                                       first.
  576.  
  577.           -------------------------------------------------------
  578.  
  579.           The following commands cause an exit from the editor,
  580.           for example, by bringing up a dialog box. The macro
  581.           resumes when the editor window regains the focus.
  582.  
  583.           The keys listed next to some of the commands below are
  584.           the ones used by default.
  585.  
  586.           -------------------------------------------------------
  587.  
  588.           ChangeDirectory     Opens a dialog box for changing the
  589.                               current directory.
  590.  
  591.           ChangeModeFlags     Used after a command such as
  592.                               ToggleInsert which changes the
  593.                               state of an editor option switch.
  594.                               Causes the IDE to update various
  595.                               menu items and/or icons.
  596.  
  597.           ClipCopy            Copys selected text to Clipboard
  598.                               (Ctrl+Ins).
  599.  
  600.           ClipCut             Cuts selected text to Clipboard
  601.                               (Shift+Del).
  602.  
  603.           ClipPaste           Pastes Clipboard into buffer at
  604.                               cursor (Shift+Ins).
  605.  
  606.           ClipShow            Shows Clipboard (no hot key
  607.                               defined).
  608.  
  609.           CloseWindow         Closes editor window (Alt+F3).
  610.  
  611.           CompileFile         Compiles current buffer (Alt+F9).
  612.  
  613.           CompileMenu         Selects Compile menu (Alt+C).
  614.  
  615.           CompilerOptions     Inserts compiler options string
  616.                               at the top of file (Ctrl+O O).
  617.  
  618.           EditMenu            Selects Edit menu (Alt+E).
  619.  
  620.           FileMenu            Selects File menu (Alt+F).
  621.  
  622.           GetFindString       Opens a dialog box for the Search
  623.                               operation. (Alt+S F)
  624.  
  625.           GotoWindow1         Selects window #1 (Alt+1).
  626.  
  627.           GotoWindow2         Selects window #2 (Alt+2).
  628.  
  629.           GotoWindow3         Selects window #3 (Alt+3).
  630.  
  631.           GotoWindow4         Selects window #4 (Alt+4).
  632.  
  633.           GotoWindow5         Selects window #5 (Alt+5).
  634.  
  635.           GotoWindow6         Selects window #6 (Alt+6).
  636.  
  637.           GotoWindow7         Selects window #7 (Alt+7).
  638.  
  639.           GotoWindow8         Selects window #8 (Alt+8).
  640.  
  641.           GotoWindow9         Selects window #9 (Alt+9).
  642.  
  643.           Help                Opens the Help window (F1).
  644.  
  645.           HelpMenu            Selects Help menu (Alt+H).
  646.  
  647.           HelpIndex           Display the Help system's index
  648.                               (Shift+F1).
  649.  
  650.           LastHelp            Opens previous help window (Alt+F1).
  651.  
  652.           MakeProject         Makes project (F9).
  653.  
  654.           Menu                Highlights top menu bar.
  655.  
  656.           Modify              Evaluates expression/modify
  657.                               variable (Ctrl+F4).
  658.  
  659.           NextWindow          Selects next window in IDE (F6).
  660.  
  661.           OpenFile            Opens dialog box for File Open (F3).
  662.  
  663.           OptionsMenu         Selects Options menu (Alt+O).
  664.  
  665.           PrintBlock          Writes selected text to the
  666.                               printer.
  667.  
  668.           Quit                Exits the IDE (Alt+X).
  669.  
  670.           ReadBlock           Opens dialog box requesting a file
  671.                               name to be read into the buffer at
  672.                               the cursor location and marked as
  673.                               selected text.
  674.  
  675.           RepeatSearch        Searches again, using previous
  676.                               parameters.
  677.  
  678.           Replace             Opens an dialog box for the Replace
  679.                               operation.
  680.  
  681.           RunMenu             Selects Run menu (Alt+R).
  682.  
  683.           RunProgram          Makes and runs current executable
  684.                               (Ctrl+F9).
  685.  
  686.           SaveFile            Saves current editor buffer (F2).
  687.  
  688.           SaveFileAs          Opens dialog for File SaveAs.
  689.  
  690.           SearchMenu          Selects Search menu (Alt+S).
  691.  
  692.           SystemMenu          Selects System menu (Alt+Spacebar).
  693.  
  694.           WindowList          Displays window list (Alt+0).
  695.  
  696.           WindowMenu          Selects Window menu (Alt+W).
  697.  
  698.           WindowCascade       Cascades windows (Shift+F5).
  699.  
  700.           WindowTile          Tiles windows (Shift+F4).
  701.  
  702.           WordHelp            Context sensitive help (Ctrl+F1).
  703.  
  704.           WriteBlock          Opens dialog box requesting a file
  705.                               name to which the selected text
  706.                               will be written.
  707.  
  708.           ZoomWindow          Zooms/unzooms current window (F5).
  709.  
  710. ===========================================================================
  711. ===========================================================================
  712.