home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / wp / pct2_2.zip / PCTDOC1.EXE / lha / CHAP18.TXT < prev    next >
Text File  |  1989-04-21  |  26KB  |  561 lines

  1.        subject: KEYSTROKE MACROS OVERVIEW
  2.  
  3.        purpose: A macro is a stored sequence of keystrokes.  Once you
  4.                 have defined a macro you can invoke or "replay" the
  5.                 macro at any time.
  6.  
  7.     discussion: If you find yourself typing the same set of keystrokes
  8.                 again and again, you probably want to define a macro.
  9.                 PC-Type II memorizes your keystrokes as you define the
  10.                 macro.  Macros can be used for any PC-Type II process.
  11.                 You can even have the macro pause while you enter some
  12.                 unique set of keystrokes, and then continue on when
  13.                 you are done.
  14.  
  15.                 Once a macro has been defined, you can define a
  16.                 special keystroke for that macro, give it a name, and
  17.                 save it in a file.  You can define up to 25 different
  18.                 macros per macro file and can have unlimited macro
  19.                 files.
  20.  
  21.                 Keystrokes reserved for macros are Alt A through Alt Z
  22.                 (with the exception of Alt Y).  A macro can call other
  23.                 macros, or can even call itself.  If it calls itself,
  24.                 it is called a recursive macro.  A macro cannot
  25.                 reference a macro in a different .MAC (macro) file.
  26.  
  27.                 Once a macro is defined, you can invoke the macro
  28.                 whenever necessary.  If an error message is issued
  29.                 either during the creation of a macro, or during the
  30.                 replay of a macro, the definition or replay will be
  31.                 stopped.  This can be particularly useful for
  32.                 automatically stopping a recursive macro when it
  33.                 reaches the bottom of a file.
  34.  
  35.                 You can change the name of a macro, delete a macro,
  36.                 modify the keystrokes stored in a macro, and reassign
  37.                 the macro key.
  38.  
  39.                 Keystroke macros cannot be used when viewing a graph
  40.                 created with the Graph command, with the DOS command,
  41.                 or outside of PC-Type II.  When you quit PC-Type II, the
  42.                 macro will stop running.
  43.  
  44.                 You can, however, execute a macro automatically when
  45.                 you start PC-Type II.  This allows you to have PC-Type
  46.                  II
  47.                 perform a series of keystrokes each time you start the
  48.                 program.  (See the section Starting PC-Type II on page
  49.                 45.)
  50.  
  51.                 NOTE: Try to keep macros general by keeping them
  52.                       independent of the configuration toggle
  53.                       settings.  For example, use Ctrl I to insert a
  54.                       new line instead of Enter since one Enter mode
  55.                       does not insert new lines.
  56.                                  189
  57.        subject: KEYSTROKE MACRO DEFINITION
  58.  
  59.        purpose: The macro definition process memorizes a set of
  60.                 keystrokes and saves them in a buffer.
  61.  
  62.     discussion: While PC-Type II memorizes your keystrokes, a Y will
  63.                 flash in the double line at the top left of your
  64.                 screen to remind you that a macro definition is in
  65.                 progress.
  66.  
  67.                 There are three steps for defining a macro.
  68.  
  69.             (1) Start defining the macro by pressing Alt Y.
  70.                 Alternatively, you can begin defining the macro by
  71.                 pressing 0 from the Keystroke Macros menu shown below.
  72.                 This menu appears by pressing the (M)acro option in
  73.                 the Main Menu.
  74.                 ┌──────────────────────┐
  75.                 │Keystroke Macros:     │
  76.                 ╞══════════════════════╡
  77.                 │ Y Save the Y macro   │
  78.                 │ 0 Begin new macro    │
  79.                 │ C clean up dir file  │
  80.                 │ P place . in filespec│
  81.                 │ 1 EXIT               │
  82.                 └──────────────────────┘
  83.                 NOTE: If no macro existed in the temporary buffer, the
  84.                       line "Save the Y macro" would be shown.
  85.  
  86.                 When a macro definition is completed it is saved
  87.                 in a temporary buffer until it is assigned its own
  88.                 keystroke.  If you initiate the definition of a
  89.                 new macro while a previously defined macro still
  90.                 resides in that temporary buffer, then the message
  91.                 shown below will be displayed.
  92.                 ┌────────────────────────────────────┐
  93.                 │Question:                           │
  94.                 ╞════════════════════════════════════╡
  95.                 │                                    │
  96.                 │Current Y macro will be lost.  Okay?│
  97.                 │Press Y or N                        │
  98.                 │                                    │
  99.                 └────────────────────────────────────┘
  100.                 If you answer N, then the initiation of a new
  101.                 macro is cancelled.  At this point you could
  102.                 permanently save the temporary macro by going to
  103.                 the Keystroke Macro menu shown above, and pressing
  104.                 Y to "Save the Y macro".
  105.  
  106.                 If you answer Y, then the macro in the temporary
  107.                 buffer is erased, and the new definition proceeds.
  108.  
  109.                 When the new macro is initiated, a Y will flash in
  110.                 the double line in the status area of your screen.
  111.  
  112.                                  190
  113.             (2) Type the text, commands, menu options, etc. which
  114.                 you want stored in the macro.  These keystrokes
  115.                 can include other macros which have already been
  116.                 defined.
  117.  
  118.                 Special macro keystrokes:
  119.  
  120.                  Ctrl F7 - Cancels the macro definition.
  121.  
  122.                            If you make a mistake when defining a
  123.                            macro, you can abort the macro
  124.                            definition by pressing Ctrl F7 and start
  125.                            over, or you can continue the macro
  126.                            definition and later modify the macro to
  127.                            remove any unwanted keystrokes.
  128.  
  129.                   Ctrl K - Temporarily suspends the macro
  130.                            definition allowing you to make
  131.                            keystrokes which will not be remembered.
  132.                            The definition will resume as soon as
  133.                            you press the Enter key.
  134.  
  135.                            When you press Ctrl K, a K will begin
  136.                            flashing next to the Y on the double
  137.                            line at the top left of your screen.
  138.                            After you press Enter, the K will stop
  139.                            flashing.
  140.  
  141.                            When you run the finished macro, PC-Type II
  142.                            will process all keystrokes up to the
  143.                            Ctrl K and suspend the macro until you
  144.                            press the Enter key, and then continue
  145.                            with the remainder of the macro
  146.                            sequence.
  147.  
  148.                 Ctrl Ins - Forces the Insert/Overwrite mode to
  149.                            Insert.
  150.  
  151.                            For macros to be generalized, you must
  152.                            account for the state of PC-Type II when
  153.                            the macro begins.  For example, it is
  154.                            often useful to press the Home key
  155.                            before beginning a macro to be sure you
  156.                            are at the left margin.
  157.  
  158.                            Ctrl Ins will insure that the
  159.                            Insert/Overwrite state of PC-Type II is
  160.                            Insert.  Should you want to make sure
  161.                            that the state was Overwrite, then press
  162.                            Ctrl Ins followed by just Ins at the
  163.                            beginning of your macro.
  164.  
  165.  
  166.  
  167.  
  168.                                  191
  169.             (3) Stop the macro definition by pressing Alt Y (or Ctrl
  170.                 Ctrl Y).
  171.  
  172.                 Normally you stop the macro definition by pressing
  173.                 Alt Y.
  174.  
  175.                 If you press Ctrl Y, then the macro is recursive, that
  176.                 is, when it is run, it will repeat itself when it has
  177.                 finished all its memorized keystrokes.
  178.  
  179.                 After pressing Alt Y or Ctrl Y, the question below
  180.                 will be asked.
  181.                 ┌───────────────┐
  182.                 │Question:      │
  183.                 ╞═══════════════╡
  184.                 │               │
  185.                 │Save macro now?│
  186.                 │Press Y or N   │
  187.                 │               │
  188.                 └───────────────┘
  189.  
  190.                 NOTE: If a menu is displayed when you stop the
  191.                       macro definition, you will not be asked if
  192.                       you want to "Save macro now?".
  193.  
  194.                 If you answer N, the macro will only be available
  195.                 during the current PC-Type II session.  When you
  196.                 leave PC-Type II, the macro will be lost.  The macro
  197.                 will also be lost if you define another macro in
  198.                 the current session.  Of course you can make the Y
  199.                 macro permanent before defining another macro or
  200.                 quitting PC-Type II.
  201.  
  202.                 If you answer Y, you will be asked:
  203.  
  204.                 Press key to be used to start new macro:
  205.                 A through Z (except Y) acceptable.
  206.  
  207.                 Y cannot be used because Y is used to start and
  208.                 stop macro definitions.  If the key you select has
  209.                 already been assigned to another macro, PC-Type II
  210.                 gives you the option of overwriting the existing
  211.                 macro, or selecting a different key.
  212.  
  213.                 Enter descriptive word(s) for the macro
  214.  
  215.                 At this point you can enter a name for the macro
  216.                 you defined which will help you remember what the
  217.                 macro does.  These names are displayed in the
  218.                 Keystroke Macros menu.
  219.  
  220.                 In the Keystroke Macros menu displayed on page 196,
  221.                 for one macro the letter 'C' was selected and the name
  222.                 provided for it was "clean up dir file".  This macro
  223.                 is run by pressing Alt C.
  224.                                  192
  225.        subject: RUNNING MACROS
  226.  
  227.        general: (1) When a macro is run, PC-Type II displays a flashing M
  228.                     in the upper left corner of your screen.  When the
  229.                     macro is finished, the flashing M will disappear.
  230.  
  231.                 (2) If you entered a Ctrl K in your macro, when the
  232.                     macro gets to that stroke, the cursor will change
  233.                     to a rectangle at the top of the character, and a
  234.                     K will flash next to the M cited above.  You can
  235.                     type any keystrokes you want in this mode.  After
  236.                     you press the Enter key to finish your entry, the
  237.                     K will disappear and the macro will continue.
  238.  
  239.                 (3) If you need to stop the macro, press Ctrl F7. (Esc
  240.                     will also work under most conditions, but not when
  241.                     the K is flashing.)
  242.  
  243.                 (4) The macro will stop when it has processed all its
  244.                     keystrokes, if an error condition is encountered,
  245.                     or if an attempt is made to move the cursor before
  246.                     the beginning or after the end of the file.
  247.  
  248.        Y macro: Once a macro has been defined and left in the macro
  249.                 buffer, (i.e., not assigned a keystroke and not
  250.                 assigned a name), it can be run by pressing Ctrl Y.
  251.  
  252. Assigned Macro: Once you have defined a letter key and a name to a
  253.                 macro, it is no longer kept in the Y macro buffer.
  254.                 These macros can be started in one of two ways.
  255.  
  256.                 (1) Hold down the Alt key and press the letter key
  257.                     under which the macro was saved.  For example,
  258.                     hold down the Alt key and press C.
  259.  
  260.                 (2) Go the Keystroke Macros menu by selecting the
  261.                     (M)acros option in the Main Menu.  Then press the
  262.                     letter to which the ïmacro was assigned.  This
  263.                     will cause a menu like the one shown below to be
  264.                     displayed.
  265.  
  266.                 ┌────────────────────┐
  267.                 │ C clean up dir file│
  268.                 ╞════════════════════╡
  269.                 │ (C)hange name      │
  270.                 │ (D)elete           │
  271.                 │ (E)xecute          │
  272.                 │ (M)odify           │
  273.                 │ (R)eassign         │
  274.                 │ e(X)it             │
  275.                 └────────────────────┘
  276.  
  277.                 Select the (E)xecute option by pressing E.  (The
  278.                 heading in this menu displays the macro you selected.)
  279.  
  280.                                  193
  281.        subject: MODIFYING MACROS
  282.  
  283.        purpose: Once a macro has been defined, given a keystroke and a
  284.                 name, the keystroke, the name, and the macro itself
  285.                 can be changed.  It can also be deleted.
  286.  
  287.     discussion: Go the Keystroke Macros menu, (select the (M)acros
  288.                 option in the Main Menu), and press the letter to
  289.                 which the macro was assigned.
  290.                 ┌──────────────────────┐
  291.                 │Keystroke Macros:     │
  292.                 ╞══════════════════════╡
  293.                 │ Y Save Y macro       │
  294.                 │ 0 Begin new macro    │
  295.                 │ C clean up dir file  │
  296.                 │ P place . in filespec│
  297.                 │ 1 EXIT               │
  298.                 └──────────────────────┘
  299.                 In the sample Keystroke Macros menu above, C was
  300.                 pressed, causing the menu below to be displayed.
  301.                 ┌────────────────────┐
  302.                 │ C clean up dir file│
  303.                 ╞════════════════════╡
  304.                 │ (C)hange name      │
  305.                 │ (D)elete           │
  306.                 │ (E)xecute          │
  307.                 │ (M)odify           │
  308.                 │ (R)eassign         │
  309.                 │ e(X)it             │
  310.                 └────────────────────┘
  311.                 Except for the (E)xecute and (D)elete options, you
  312.                 will return to this menu when you have finished the
  313.                 selected option.  Press X or Esc to exit the keystroke
  314.                 macro menus.
  315.  
  316.                 The macro options available are:
  317.  
  318.                 (C)hange name - modify the name.
  319.                 (D)elete      - remove the macro after confirmation.
  320.                 (E)xecute     - run the macro.
  321.                 (M)odify      - edit/change the keystrokes in the
  322.                                 macro.
  323.                 (R)eassign    - change the key assigned to the macro.
  324.  
  325.                 NOTE: If you change the key assigned to a macro which
  326.                       is called by other macros, those calls will not
  327.                       be modified.
  328.  
  329.                 Except for the Execute option, these changes will not
  330.                 be made permanent until you save the macros to a disk
  331.                 file using the (F)ile handling option of the
  332.                 Configuration Menu.
  333.  
  334.                 NOTE: The Y macro buffer cannot be modified until it
  335.                       has been assigned a key and a name.
  336.                                  194
  337.        subject: EDITING MACROS
  338.  
  339.        purpose: The keystrokes defined in a macro can be modified
  340.                 without having to go through the steps of memorizing
  341.                 keystrokes all over again.
  342.  
  343.     discussion: To modify a macro, select the (M)odify option of the
  344.                 second menu displayed on the preceding page.  The
  345.                 keystrokes in the macro are displayed where the
  346.                 Command Line is located.
  347.  
  348.                 Letters, numbers and punctuation will be displayed
  349.                 as typed.  Cursor keys, Enter, function keys, Ctrl and
  350.                 Alt key combinations, etc., are assigned codes.
  351.  
  352.                 The code characters are surrounded with { and }.
  353.                 Inside {} is the key code.  These codes are:
  354.  
  355.                 {Fx} - Function key  where x is the function key number.
  356.                        F10 would look like {F10}.
  357.                 {Cx} - generally means Ctrl x where x is the designated
  358.                        key.  Ctrl B would look like {CB}.
  359.                 {Ax} - means Alt x  where x is the designated key.  Alt 1
  360.                        would look like {A1}.
  361.                 {Sx} - means Shift x where x is the designated key.
  362.                        Shift F10 would look like {SF10}.  (This code
  363.                        only works for Function keys and the Tab key.)
  364.  
  365.                 Other key codes you need to know are:
  366.                    {EOM} - End of macro      {ESC} - Esc key
  367.                     {BS} - Backspace         {DEL} - Del key
  368.                   {DOWN} - down arrow      {CDOWN} - Ctrl down arrow
  369.                    {END} - End key          {CEND} - Ctrl End key
  370.                  {ENTER} - Enter key      {CENTER} - Ctrl Enter key
  371.                   {HOME} - Home key        {CHOME} - Ctrl Home key
  372.                    {INS} - Ins key          {CINS} - Ctrl Ins key
  373.                   {LEFT} - left arrow      {CLEFT} - Ctrl left arrow
  374.                   {PGDN} - PgDn key        {CPGDN} - Ctrl PgDn key
  375.                   {PGUP} - PgUp key        {CPGUP} - Ctrl PgUp key
  376.                  {RIGHT} - right arrow    {CRIGHT} - Ctrl right arrow
  377.                     {UP} - up arrow          {CUP} - Ctrl up arrow
  378.                     {C\} - Ctrl Backslash     {C_} - Ctrl underscore
  379.                      {T} - Tab                {ST} - Shift Tab key
  380.  
  381.        Example: The macro below was created to close a letter with a
  382.                 blank line, then type the string "Sincerely,", three
  383.                 blank lines, and the name "Dick".
  384.  
  385.               {CI}{CI}{HOME}Sincerely,{CI}{CI}{CI}{CI}{HOME}Dick{EOM}
  386.  
  387.                 NOTE: When you edit a macro, it should end with {EOM},
  388.                       (end of macro), so that spaces at the end will
  389.                       not be lost.
  390.  
  391.  
  392.                                  195
  393.        subject: SAVING KEYSTROKE MACROS
  394.  
  395.        purpose: In order to use a defined macro in another PC-Type II
  396.                 session, it must be saved to disk.
  397.  
  398.        Y macro: If the defined macro is still in the temporary buffer,
  399.                 (called the Y macro), then it must first be assigned a
  400.                 keystroke before it can be saved to disk.  This is
  401.                 accomplished by:
  402.  
  403.                 (1) accessing the Keystroke Macro Menu (select the
  404.                     (M)acros option from the Main Menu).
  405.                 (2) selecting the Save the Y macro option by pressing Y.
  406.                 (3) assigning a key to the macro and giving the macro
  407.                     a name as discussed on page 198.
  408.  
  409. Macros to disk: Macros which have been assigned keystrokes and given
  410.                 names, can be used by holding down the Alt key and
  411.                 pressing the key assigned to the macro.  However, they
  412.                 must be saved to disk in a .MAC file to be available
  413.                 for other PC-Type II sessions.
  414.  
  415.                 To save a set of macros to disk, select the (F)ile
  416.                 handling option in the Configuration Menu.  Press 3
  417.                 (Macro file to disk), and you will be asked to enter a
  418.                 path and a filename for the set of macros.  (PC-Type II
  419.                 will assign the file extension .MAC automatically.)
  420.  
  421.    .MAC format: A .MAC file is an ASCII file and can be edited.  In
  422.                 the ensuing discussion, refer to the example below.
  423.  
  424.                 The first line of a .MAC file is a header line which
  425.                 specifies the number of Keystroke macros in the file.
  426.  
  427.                 Following the header line is the first macro.  Its
  428.                 assigned key is in parentheses followed by the macro
  429.                 name.  Finally, each keystroke in the macro is given.
  430.  
  431.                 NOTE: Since macro names can be 25 characters long, at
  432.                       least 25 character positions should be left
  433.                       between the beginning of the macro name and the
  434.                       beginning of the macro keystroke description.
  435.  
  436.                 Many macros require more than one line.  Each line of
  437.                 a keystroke definition must begin with a \ character.
  438.                 If the line ends with a \ character it implies another
  439.                 line of keystrokes for the same macro follows.  The
  440.                 macro should end with the {EOM} (end of macro) code.
  441.                 (See Editing Macros for a definition of the keystroke
  442.                 codes).
  443.  
  444.        example: PC-Type II Macros  2
  445.                 (C) clean up dir file        \{CPGUP}{F5}{F5}{F5}{F5}\
  446.                                              \{CPGDN}{F5}{END}{EOM}
  447.  
  448.                                  196
  449.        subject: LOADING .MAC FILES
  450.  
  451.        purpose: You can save macros in numerous .MAC files.  To be
  452.                 able to execute macros saved in these files, they must
  453.                 be loaded into PC-Type II.
  454.  
  455.     discussion: Macros can be loaded from disk into PC-Type II in 3 ways:
  456.  
  457.                 (1) By reference in the .PRO file loaded at the start
  458.                     of a session or during a session.  (See the
  459.                     section Configuration Files on page 108.)
  460.  
  461.                 (2) Loaded directly from the (F)ile Handling option in
  462.                     the Configuration Menu.   (See the section
  463.                     Configuration Files on page 118.)
  464.  
  465.                 (3) As a command line option when PC-Type II is started
  466.                     from DOS.  In this option, even if the .PRO file
  467.                     loaded contains a reference to a macro file, the
  468.                     command line option will override that reference
  469.                     and load the macro file specified.  (See Command
  470.                     Line Options in the section Starting PC-Type II.)
  471.  
  472.                 When a different set of macros is loaded, the previous
  473.                 set is no longer available for use until it is
  474.                 reloaded.
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.                                  197
  505.        subject: MACRO HINTS
  506.  
  507.        purpose: By following certain conventions, macros can be made
  508.                 more general and useful.
  509.  
  510.     discussion: As a general rule, always try to define a macro in
  511.                 such a way as to be independent of specific PC-Type II
  512.                 states.
  513.  
  514.                 It is safer to begin macros from either the text area
  515.                 or from the Command Line.  If a macro is started from
  516.                 a menu, you must insure that you are in that same menu
  517.                 before starting the macro for it to work properly.
  518.  
  519.                 If you want a macro to always begin in the text area,
  520.                 you should begin it with a keystroke, or combination
  521.                 of keystrokes to guarantee that it is in the text
  522.                 area, such as Ctrl Home or the down arrow followed by
  523.                 the up arrow.
  524.  
  525.                 If you want a macro to always begin on the Command
  526.                 Line, do the same as above and followed by Esc.
  527.  
  528.                 It is useful to begin a macro with the Home key to
  529.                 insure the cursor is positioned at the left margin of
  530.                 the text or the home position of the Command Line.
  531.  
  532.                 It is a good practice to insure that the
  533.                 Insert/Overwrite state is always in the same condition
  534.                 when defining a macro.  Ctrl Ins insures that it is in
  535.                 the Insert state.  Ctrl Ins followed by Ins insures
  536.                 that it is in the Overwrite State.
  537.  
  538.                 Insure that no highlighting exists when you begin a
  539.                 macro which highlights text areas.  Begin such macros
  540.                 with Ctrl U.
  541.  
  542.                 Use F10 when possible to execute commands.  It is very
  543.                 powerful when used in conjunction with recursive
  544.                 macros.
  545.  
  546.                 Finally, give the macros meaningful names when you
  547.                 save them.  It is easy to forget what function a macro
  548.                 performs, and long macros are not easy to read.
  549.  
  550.                 NOTE: .MAC files are ASCII files and can be edited.
  551.                       We recommend, however, that you modify your
  552.                       macro files inside PC-Type II.  Errors are far
  553.                       less likely to occur.
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.                                  198
  561.