""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
   PROGRAM YOUR OWN PLAYBACK FILES USING CHAR CODES
   """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
   PRODUCT   :  R:BASE                  VERSION      :  3.1
   CATEGORY  :  PROGRAMMING             SUBCATEGORY  :  TOOLS
   """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
   You can have an R:BASE program create a playback (script) file for you
   in situations like the following where it isn't convenient to record
   it.
 
     o  Collect information from the user right in the middle of a
        playback file by creating and playing the first half, collecting
        the information, and then building and playing the second half of
        the playback.
     o  Create and play a playback file in an entry/exit procedure (EEP)
        in an R:BASE form in order to pass a value back to a field in the
        form.
     o  Define function key combinations (key maps) for different uses.
        For example, you can automatically assign the current date to
        [Alt-F3].
 
 
   Defining [Alt-F3] Key Map
   """""""""""""""""""""""""
   The following program assigns the current date to [Alt-F3] in R:BASE
   3.1:
 
     *( ALT_F3.CMD--Enter date & press [Enter].)
     SET VAR +
       vkey TEXT = (CHAR(0) + CHAR(106)), +
       vvalue TEXT = (CTXT(.#DATE)), +
       vpb TEXT = (CHAR(0) + CHAR(94) +
         + 'D' + CHAR(13) + .vkey + .vvalue +
         + CHAR(13) + CHAR(0) + CHAR(95) +
         + CHAR(0) + CHAR(95))
     OUTPUT pb.$$$  *( Write playback file)
     WRITE .vpb
     OUTPUT SCREEN
     PLAY pb.$$$  *( Play it.)
     CLEAR VAR vkey, vvalue, vpb
     RETURN
 
   If you didn't want it to press [Enter] after entering the system date,
   remove the CHAR(13) following VVALUE. VKEY holds the code (CHAR(0) +
   CHAR(106)) for the key to press ([Alt-F3]), and VVALUE holds the value
   you want to assign. VPB holds the CHAR values needed to define the
   playback.
 
 
   Another Key Map Example
   """""""""""""""""""""""
   A Microrim BBS user suggested assigning text to a function key
   combination as a shortcut when filling in a TEXT field in a form. You
   could assign a default value of "Please contact" to a form field and
   then assign keys to different contact people. For example, press [Alt-
   1] to go to the end of the field and enter "Mr. Smith at X345" or
   press [Alt-2] to go to the end of the field and enter "Mr. Jones at
   X456." The user can examine the form to determine who should be
   contacted, and complete the field with a single keystroke. Run this
   program to create the key maps:
 
     *( CONTACTS.CMD--finish off a field.)
     SET VAR +
       vkey TEXT = (CHAR(0) + CHAR(120)), +
       vvalue TEXT = (CHAR(0) + CHAR(79) +
         + 'Mr. Smith at X345'), +
       vpb TEXT = (CHAR(0) + CHAR(94) +
         + 'D' + CHAR(13) + .vkey + .vvalue +
         + CHAR(13) + CHAR(0) + CHAR(95))
     SET VAR +
       vkey TEXT = (CHAR(0) + CHAR(121)), +
       vvalue TEXT = (CHAR(0) + CHAR(79) +
         + 'Mr. Jones at X456'), +
       vpb TEXT = (.vpb + CHAR(0) + CHAR(94) +
         + 'D' + CHAR(13) + .vkey + .vvalue +
         + CHAR(13) + CHAR(0) + CHAR(95) +
         + CHAR(0) + CHAR(95))
     OUTPUT pb.$$$  *( Write playback file)
     WRITE .vpb
     OUTPUT SCREEN
     PLAY pb.$$$  *( Play it.)
     CLEAR VAR vkey, vvalue, vpb
     RETURN
 
 
   Codes for Special Key Presses
   """"""""""""""""""""""""""""""
   Put all key presses into one variable using the following CHAR codes
   to press function keys or [Alt-n] keys:
 
   [F1]            (CHAR(0) + CHAR(59))
                   .
                   .
                   .
   [F10]           (CHAR(0) + CHAR(68))
   ------------------------------------------
   [Ctrl-F1]       (CHAR(0) + CHAR(94))
                   .
                   .
                   .
   [Ctrl-F10]      (CHAR(0) + CHAR(103))
   ------------------------------------------
   [Shift-F1]      (CHAR(0) + CHAR(84))
                   .
                   .
                   .
   [Shift-F10]     (CHAR(0) + CHAR(93))
   ------------------------------------------
   [Alt-F1]        (CHAR(0) + CHAR(104))
                   .
                   .
                   .
   [Alt-F10]       (CHAR(0) + CHAR(113))
   ------------------------------------------
   [Alt-1]         (CHAR(0) + CHAR(120))
                   .
                   .
                   .
   [Alt-0]         (CHAR(0) + CHAR(129))
 
   Here are a few examples:
 
     [F2]          (CHAR(0) + CHAR(60))
     [F7]          (CHAR(0) + CHAR(65))
     [Shift-F8]    (CHAR(0) + CHAR(91)).
 
   Here are more CHAR codes:
 
     [Enter]       (CHAR(13))
     [Tab]         (CHAR(9))
     [Esc]         (CHAR(27))
     [Right]       (CHAR(0) + CHAR(77))
     [Left]        (CHAR(0) + CHAR(75))
     [Up]          (CHAR(0) + CHAR(72))
     [Down]        (CHAR(0) + CHAR(80))
     [Shift-Tab]   (CHAR(0) + CHAR(15))
     [PgUp]        (CHAR(0) + CHAR(73))
     [PgDn]        (CHAR(0) + CHAR(81))
     [Home]        (CHAR(0) + CHAR(71))
     [End]         (CHAR(0) + CHAR(79))
     [Ins]         (CHAR(0) + CHAR(82))
     [Del]         (CHAR(0) + CHAR(83))
     [Ctrl-Left]   (CHAR(0) + CHAR(115))
     [Ctrl-Right]  (CHAR(0) + CHAR(116))
     [Ctrl-End]    (CHAR(0) + CHAR(117))
     [Ctrl-PgDn]   (CHAR(0) + CHAR(118))
     [Ctrl-PgUp]   (CHAR(0) + CHAR(132))
     [Ctrl-Home]   (CHAR(0) + CHAR(119))
 
   Use these codes to create playback files to act as keyboard robots.