home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
epmrex.zip
/
EPMREXX.DOC
< prev
next >
Wrap
Text File
|
1996-01-26
|
11KB
|
263 lines
[The following was written for people with access to the internal macro
language documentation. I've updated it to include some of that extra
information; please let me know if anything is not clear. -- LAM]
STARTING AN EPM REXX MACRO
__________________________
To start an EPM REXX macro use the RX command at the EPM
command line. For example,
RX EPMTEST
would run the EPMTEST.ERX macro file.
EXTRACTING EPM VARIABLES.
_________________________
All the dot variables of EPM are extractable into REXX using
the extract command. For example, 'extract /getline' would
set the REXX variable getline.0 to 1 (the number of vari-
ables returned) and getline.1 to the contents of the current
line.
The fields that are extractable are:
autosave -- Current autosave value
col -- Absolute column number that the cursor is in
cursorx -- Screen-relative cursor column
cursory -- Screen-relative cursor row
dragcolor -- Color painted when drag-marking
dragstyle -- Style of current drag; 1,2,3 = Block, Line, Char.
eaarea -- Long pointer to buffer containing extended attributes
for current file. (FEALIST)
fileinfo -- A copy of the FILESTATUS4 structure returned from the
DosQueryFileInfo call. (See OS/2 Toolkit for details.)
filename -- Current file name
fontheight -- Height of current file's default font, in pels
fontwidth -- Width of current file's default font, in pels
last -- Number of lines in current file
lockhandle -- File handle if file is locked (using LOCK command)
line -- Line number that cursor is on.
markcolor -- Color used for marked text
modify -- Modify count; 0 if file is unmodified, or 1 to .autosave
mousex -- X position of mouse pointer, in pels
mousey -- Y position of mouse pointer, in pels
textcolor -- Color used for unmarked text
userstring -- Spare field available for macro use
visible -- Boolean flag specifying whether or not file is
-- visible. Invisible files are skipped over as you
-- move around the ring, and discarded (even if modified)
-- when quitting the last visible file in the ring.
windowheight -- Height of edit window in characters
windowwidth -- Width of edit window in characters
windowx -- gap between the bottom end of the client window's
-- presentation space and the bottom end of the client window.
windowy -- gap between the right edge of the client window's
-- presentation space and the right edge of the client window.
font -- default font for window (a number representing an
-- entry in an internal font table)
getmarktype -- Not a real field; see below
getmark -- "
getline -- "
insertstate -- "
version -- "
SPECIAL FIELD VARIABLES.
________________________
Since some of the extractable variables are not true EPM
fields, additional documentation is necessary.
VARIABLE MEANING
________ _______
Getmarktype Getmarktype.0 is the number of variables
extracted. Getmarktype.1 is the mark
type. A NULL string means there is no
mark set. Other possible values are:
"LINE", "CHAR", "BLOCK", "CHARG", "BLOCKG".
Getmark Getmark.0 is the number of variables ex-
tracted. Getmark.1 is the first marked
line. Getmark.2 is the last marked
line. Getmark.3 is the first marked
column. Getmark.4 is the last marked
column. Getmark.5 is the fileid of the
file containing the mark.
Getline Getline.0 is the number of variables ex-
tracted. Getline.1 is the contents of
the current line.
Insertstate Insertstate.0 is the number of variables
extracted. Insertstate.1 is 1 if insert
mode is on, or 0 if it is off. (EPM 5.60
and above only.)
Version Version.0 is the number of variables
extracted. Version.1 is the version
number, in the format major * 10000 +
minor * 100 + beta, so 6.03a would be
603010. Version.2 is the minimum
version .ex file that the executing EPM
will accept, in the same format as
version.1.
USING THE EPM FUNCTIONS
_______________________
LINE-ORIENTED FUNCTIONS
_______________________
The EPM functions that are available from REXX are a subset
of the EPM programming language functions. Examples of the
functions that are available are:
/*
* Name EPMTEST.ERX
*
* Author Ralph E. Yozzo
*
* Function A Rexx Macro for EPM
*
*/
Call etkdeletetext /* delete current line in current file */
Call etkdeletetext 1 /* delete line 1 in current file */
Call etkdeletetext 1, fid /* delete line 1 in file <fid> */
Call etkinserttext 'line' /* insert before curr. line in curr. file */
Call etkinserttext 'line', 1 /* insert string before line 1 in current file */
Call etkinserttext 'line', 1, fid /* insert string before line 1 in file <fid> */
Call etkreplacetext 'line' /* replace current line in current file */
Call etkreplacetext 'line', 1 /* replace line 1 in current file */
Call etkreplacetext 'line', 1, fid /* replace line 1 in file <fid> */
SETTING EPM FIELD FUNCTIONS
___________________________
Examples of the functions that are available are:
/*
* Name SETFIELD
*
* Author Ralph E. Yozzo
*
* Function A Rexx Macro for EPM to test the setting of fields
* See the EPM documentation for the meaning of the fields.
*
*/
call etksetfilefield 'filename' , 'newname'
call etksetfilefield 'userstring' , 'new string'
call etksetfilefield 'autosave' , 1
call etksetfilefield 'col' , 1
call etksetfilefield 'cursorx' , 1
call etksetfilefield 'cursory' , 1
call etksetfilefield 'dragcolor' , 1
call etksetfilefield 'dragstyle' , 1
call etksetfilefield 'eaarea' , 1
call etksetfilefield 'fontheight' , 1
call etksetfilefield 'fontwidth' , 1
call etksetfilefield 'last' , 1
call etksetfilefield 'lockhandle' , 1
call etksetfilefield 'line' , 1
call etksetfilefield 'markcolor' , 1
call etksetfilefield 'modify' , 1
call etksetfilefield 'mousex' , 1
call etksetfilefield 'mousey' , 1
call etksetfilefield 'textcolor' , 1
call etksetfilefield 'visible' , 1
call etksetfilefield 'windowheight' , 1
call etksetfilefield 'windowwidth' , 1
call etksetfilefield 'windowx' , 1
call etksetfilefield 'windowy' , 1
call etksetfilefield 'font' , 1
KEY-ORIENTED FUNCTIONS
______________________
[LAM: Bad name, here. This doesn't actually process keys, it executes
some of the internal functions that are otherwise only available
to users by the keys defined in the internal macro language to
use those functions. Rather than document the functions, I'll
add a comment describing the key defined to do the same thing.]
Examples of the functions that are available are:
/*
* Name KEYTESTX
*
* Author Ralph E. Yozzo
*
* Function A Rexx Macro for EPM to test the keys.
* See the EPM documentation for the meaning of the keys.
*
*/
call etkprocesseditkey "ADJUST_BLOCK" /* Alt+A */
call etkprocesseditkey "BACKTAB" /* Shift+Tab */
call etkprocesseditkey "BACKTAB_WORD" /* Ctrl+Right */
call etkprocesseditkey "BEGIN_LINE" /* Home */
call etkprocesseditkey "BOTTOM" /* Ctrl+End */
call etkprocesseditkey "CENTER" /* ??? */
call etkprocesseditkey "COPY_MARK" /* Alt+C */
call etkprocesseditkey "DELETE_CHAR" /* Delete */
call etkprocesseditkey "DELETE_LINE" /* Ctrl+Backspace */
call etkprocesseditkey "DELETE_MARK" /* Alt+D */
call etkprocesseditkey "ERASE_END_LINE" /* Ctrl+E */
call etkprocesseditkey "INSERT_TOGGLE" /* Insert */
call etkprocesseditkey "JOIN" /* Alt+J */
call etkprocesseditkey "MARK_BLOCK" /* Alt+B */
call etkprocesseditkey "MARK_BLOCKG" /* */
call etkprocesseditkey "MARK_CHAR" /* Alt+Z */
call etkprocesseditkey "MARK_CHARG" /* */
call etkprocesseditkey "MARK_LINE" /* Alt+L */
call etkprocesseditkey "MARK_LINEG" /* */
call etkprocesseditkey "MOVE_MARK" /* Alt+M */
call etkprocesseditkey "NEXT_FILE" /* F12 */
call etkprocesseditkey "OVERLAY_BLOCK" /* Alt+O */
call etkprocesseditkey "PREVFILE" /* F11 */
call etkprocesseditkey "REFLOW" /* Alt+P (needs line mk) */
call etkprocesseditkey "REFRESH" /* (refresh edit window)*/
call etkprocesseditkey "REPEAT_FIND" /* Ctrl+F */
call etkprocesseditkey "RUBOUT" /* Backspace */
call etkprocesseditkey "SHIFT_LEFT" /* Ctrl+F7 */
call etkprocesseditkey "SHIFT_RIGHT" /* Ctrl+F8 */
call etkprocesseditkey "SPLIT" /* Alt+S */
call etkprocesseditkey "TAB_WORD" /* Ctrl+Right */
call etkprocesseditkey "TOP" /* Ctrl+Right */
call etkprocesseditkey "UNDO" /* F9 or Alt+Backspace */
call etkprocesseditkey "UNDOACTION" /* No equivalent; creates */
/* a new undo state. */
call etkprocesseditkey "UNMARK" /* Alt+U */
In addition, you can use any of the built-in commands, which are
documented in the on-line help.