home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / epmrex.zip / EPMREXX.DOC < prev    next >
Text File  |  1996-01-26  |  11KB  |  263 lines

  1. [The following was written for people with access to the internal macro
  2. language documentation.  I've updated it to include some of that extra
  3. information; please let me know if anything is not clear.  -- LAM]
  4.  
  5. STARTING AN EPM REXX MACRO
  6. __________________________
  7.  
  8.  
  9. To  start  an  EPM  REXX macro use the RX command at the EPM
  10. command line.  For example,
  11.  
  12.   RX EPMTEST
  13.  
  14. would run the EPMTEST.ERX macro file.
  15.  
  16.  
  17.  
  18.  
  19. EXTRACTING EPM VARIABLES.
  20. _________________________
  21.  
  22.  
  23. All the dot variables of EPM are extractable into REXX using
  24. the extract command.  For example,  'extract /getline' would
  25. set the REXX variable getline.0 to 1 (the  number  of  vari-
  26. ables returned) and getline.1 to the contents of the current
  27. line.
  28.  
  29.  
  30. The fields that are extractable are:
  31.  
  32.   autosave       -- Current autosave value
  33.   col            -- Absolute column number that the cursor is in
  34.   cursorx        -- Screen-relative cursor column
  35.   cursory        -- Screen-relative cursor row
  36.   dragcolor      -- Color painted when drag-marking
  37.   dragstyle      -- Style of current drag; 1,2,3 = Block, Line, Char.
  38.   eaarea         -- Long pointer to buffer containing extended attributes
  39.                     for current file.  (FEALIST)
  40.   fileinfo       -- A copy of the FILESTATUS4 structure returned from the
  41.                     DosQueryFileInfo call.  (See OS/2 Toolkit for details.)
  42.   filename       -- Current file name
  43.   fontheight     -- Height of current file's default font, in pels
  44.   fontwidth      -- Width of current file's default font, in pels
  45.   last           -- Number of lines in current file
  46.   lockhandle     -- File handle if file is locked (using LOCK command)
  47.   line           -- Line number that cursor is on.
  48.   markcolor      -- Color used for marked text
  49.   modify         -- Modify count; 0 if file is unmodified, or 1 to .autosave
  50.   mousex         -- X position of mouse pointer, in pels
  51.   mousey         -- Y position of mouse pointer, in pels
  52.   textcolor      -- Color used for unmarked text
  53.   userstring     -- Spare field available for macro use
  54.   visible        -- Boolean flag specifying whether or not file is
  55.                  -- visible.  Invisible files are skipped over as you
  56.                  -- move around the ring, and discarded (even if modified)
  57.                  -- when quitting the last visible file in the ring.
  58.   windowheight   -- Height of edit window in characters
  59.   windowwidth    -- Width of edit window in characters
  60.   windowx        -- gap between the bottom end of the client window's
  61.                  -- presentation space and the bottom end of the client window.
  62.   windowy        -- gap between the right edge of the client window's
  63.                  -- presentation space and the right edge of the client window.
  64.   font           -- default font for window (a number representing an
  65.                  -- entry in an internal font table)
  66.   getmarktype    -- Not a real field; see below
  67.   getmark        --  "
  68.   getline        --  "
  69.   insertstate    --  "
  70.   version        --  "
  71.  
  72.  
  73.  
  74. SPECIAL FIELD VARIABLES.
  75. ________________________
  76.  
  77.  
  78. Since  some  of  the  extractable variables are not true EPM
  79. fields, additional documentation is necessary.
  80.  
  81.  
  82.  
  83. VARIABLE            MEANING
  84. ________            _______
  85.  
  86. Getmarktype         Getmarktype.0 is the number of variables
  87.                     extracted.   Getmarktype.1 is  the  mark
  88.                     type.   A NULL string  means there is no
  89.                     mark set.   Other possible  values  are:
  90.                     "LINE", "CHAR", "BLOCK", "CHARG", "BLOCKG".
  91.  
  92.  
  93. Getmark             Getmark.0 is the number of variables ex-
  94.                     tracted.  Getmark.1 is the first  marked
  95.                     line.    Getmark.2  is the last   marked
  96.                     line.   Getmark.3 is  the  first  marked
  97.                     column.    Getmark.4 is the last  marked
  98.                     column.   Getmark.5 is the fileid of the
  99.                     file containing the mark.
  100.  
  101.  
  102. Getline             Getline.0 is the number of variables ex-
  103.                     tracted.  Getline.1 is the  contents  of
  104.                     the current line.
  105.  
  106.  
  107. Insertstate         Insertstate.0 is the number of variables
  108.                     extracted.  Insertstate.1 is 1 if insert
  109.                     mode is on, or 0 if it is off.  (EPM 5.60
  110.                     and above only.)
  111.  
  112.  
  113. Version             Version.0 is the number of variables
  114.                     extracted.  Version.1 is the version
  115.                     number, in the format major * 10000 +
  116.                     minor * 100 + beta, so 6.03a would be
  117.                     603010.  Version.2 is the minimum
  118.                     version .ex file that the executing EPM
  119.                     will accept, in the same format as
  120.                     version.1.
  121.  
  122.  
  123.  
  124. USING THE EPM FUNCTIONS
  125. _______________________
  126.  
  127.  
  128.  
  129. LINE-ORIENTED FUNCTIONS
  130. _______________________
  131.  
  132.  
  133. The  EPM functions that are available from REXX are a subset
  134. of the EPM programming language functions.  Examples of  the
  135. functions that are available are:
  136.  
  137.   /*
  138.    * Name        EPMTEST.ERX
  139.    *
  140.    * Author      Ralph E. Yozzo
  141.    *
  142.    * Function    A Rexx Macro for  EPM
  143.    *
  144.    */
  145.  
  146.   Call etkdeletetext           /* delete current line in current file */
  147.   Call etkdeletetext 1         /* delete line 1 in current file */
  148.   Call etkdeletetext 1, fid    /* delete line 1 in file <fid> */
  149.  
  150.   Call etkinserttext 'line'    /* insert before curr. line in curr. file */
  151.   Call etkinserttext 'line', 1 /* insert string before line 1 in current file */
  152.   Call etkinserttext 'line', 1, fid /* insert string before line 1 in file <fid> */
  153.  
  154.   Call etkreplacetext 'line'         /* replace current line in current file */
  155.   Call etkreplacetext 'line', 1      /* replace line 1 in current file */
  156.   Call etkreplacetext 'line', 1, fid /* replace line 1 in file <fid> */
  157.  
  158.  
  159.  
  160. SETTING EPM FIELD FUNCTIONS
  161. ___________________________
  162.  
  163.  
  164. Examples of the functions that are available are:
  165.  
  166.  
  167.   /*
  168.    * Name        SETFIELD
  169.    *
  170.    * Author      Ralph E. Yozzo
  171.    *
  172.    * Function    A Rexx Macro for  EPM to test the setting of fields
  173.    *             See the EPM documentation for the meaning of the fields.
  174.    *
  175.    */
  176.   call etksetfilefield 'filename'     ,  'newname'
  177.   call etksetfilefield 'userstring'   ,  'new string'
  178.   call etksetfilefield 'autosave'     ,  1
  179.   call etksetfilefield 'col'          ,  1
  180.   call etksetfilefield 'cursorx'      ,  1
  181.   call etksetfilefield 'cursory'      ,  1
  182.   call etksetfilefield 'dragcolor'    ,  1
  183.   call etksetfilefield 'dragstyle'    ,  1
  184.   call etksetfilefield 'eaarea'       ,  1
  185.   call etksetfilefield 'fontheight'   ,  1
  186.   call etksetfilefield 'fontwidth'    ,  1
  187.   call etksetfilefield 'last'         ,  1
  188.   call etksetfilefield 'lockhandle'   ,  1
  189.   call etksetfilefield 'line'         ,  1
  190.   call etksetfilefield 'markcolor'    ,  1
  191.   call etksetfilefield 'modify'       ,  1
  192.   call etksetfilefield 'mousex'       ,  1
  193.   call etksetfilefield 'mousey'       ,  1
  194.   call etksetfilefield 'textcolor'    ,  1
  195.   call etksetfilefield 'visible'      ,  1
  196.   call etksetfilefield 'windowheight' ,  1
  197.   call etksetfilefield 'windowwidth'  ,  1
  198.   call etksetfilefield 'windowx'      ,  1
  199.   call etksetfilefield 'windowy'      ,  1
  200.   call etksetfilefield 'font'         ,  1
  201.  
  202.  
  203.  
  204. KEY-ORIENTED FUNCTIONS
  205. ______________________
  206.  
  207. [LAM:  Bad name, here.  This doesn't actually process keys, it executes
  208.        some of the internal functions that are otherwise only available
  209.        to users by the keys defined in the internal macro language to
  210.        use those functions.  Rather than document the functions, I'll
  211.        add a comment describing the key defined to do the same thing.]
  212.  
  213. Examples of the functions that are available are:
  214.  
  215.   /*
  216.    * Name        KEYTESTX
  217.    *
  218.    * Author      Ralph E. Yozzo
  219.    *
  220.    * Function    A Rexx Macro for  EPM to test the keys.
  221.    *             See the EPM documentation for the meaning of the keys.
  222.    *
  223.    */
  224.   call etkprocesseditkey  "ADJUST_BLOCK"      /* Alt+A                 */
  225.   call etkprocesseditkey  "BACKTAB"           /* Shift+Tab             */
  226.   call etkprocesseditkey  "BACKTAB_WORD"      /* Ctrl+Right            */
  227.   call etkprocesseditkey  "BEGIN_LINE"        /* Home                  */
  228.   call etkprocesseditkey  "BOTTOM"            /* Ctrl+End              */
  229.   call etkprocesseditkey  "CENTER"            /*   ???                 */
  230.   call etkprocesseditkey  "COPY_MARK"         /* Alt+C                 */
  231.   call etkprocesseditkey  "DELETE_CHAR"       /* Delete                */
  232.   call etkprocesseditkey  "DELETE_LINE"       /* Ctrl+Backspace        */
  233.   call etkprocesseditkey  "DELETE_MARK"       /* Alt+D                 */
  234.   call etkprocesseditkey  "ERASE_END_LINE"    /* Ctrl+E                */
  235.   call etkprocesseditkey  "INSERT_TOGGLE"     /* Insert                */
  236.   call etkprocesseditkey  "JOIN"              /* Alt+J                 */
  237.   call etkprocesseditkey  "MARK_BLOCK"        /* Alt+B                 */
  238.   call etkprocesseditkey  "MARK_BLOCKG"       /*                       */
  239.   call etkprocesseditkey  "MARK_CHAR"         /* Alt+Z                 */
  240.   call etkprocesseditkey  "MARK_CHARG"        /*                       */
  241.   call etkprocesseditkey  "MARK_LINE"         /* Alt+L                 */
  242.   call etkprocesseditkey  "MARK_LINEG"        /*                       */
  243.   call etkprocesseditkey  "MOVE_MARK"         /* Alt+M                 */
  244.   call etkprocesseditkey  "NEXT_FILE"         /* F12                   */
  245.   call etkprocesseditkey  "OVERLAY_BLOCK"     /* Alt+O                 */
  246.   call etkprocesseditkey  "PREVFILE"          /* F11                   */
  247.   call etkprocesseditkey  "REFLOW"            /* Alt+P (needs line mk) */
  248.   call etkprocesseditkey  "REFRESH"           /*  (refresh edit window)*/
  249.   call etkprocesseditkey  "REPEAT_FIND"       /* Ctrl+F                */
  250.   call etkprocesseditkey  "RUBOUT"            /* Backspace             */
  251.   call etkprocesseditkey  "SHIFT_LEFT"        /* Ctrl+F7               */
  252.   call etkprocesseditkey  "SHIFT_RIGHT"       /* Ctrl+F8               */
  253.   call etkprocesseditkey  "SPLIT"             /* Alt+S                 */
  254.   call etkprocesseditkey  "TAB_WORD"          /* Ctrl+Right            */
  255.   call etkprocesseditkey  "TOP"               /* Ctrl+Right            */
  256.   call etkprocesseditkey  "UNDO"              /* F9 or Alt+Backspace   */
  257.   call etkprocesseditkey  "UNDOACTION"        /*  No equivalent; creates */
  258.                                               /*  a new undo state.    */
  259.   call etkprocesseditkey  "UNMARK"            /* Alt+U                 */
  260.  
  261. In addition, you can use any of the built-in commands, which are
  262. documented in the on-line help.
  263.