EPM -- enhancement for "relink" command

EPM -- enhancement for "relink" command

Post by Ken Arw » Mon, 24 Jun 1996 04:00:00



     There are a lot of times when I'm working on an E macro and need
to compile it to a different directory/filename, and then relink it
for testing.  This has meant issuing 3 separate EPM commands, so I
made a couple changes to the supplied "relink" command to accomplish
this in one step.
     "Relink2" takes two arguments:
          relink2 <sourcename> <targetname>
and, to save some typing, if the first argument is the equals sign it
will automatically insert the current filename.

-----cut here-----
compile if WANT_ET_COMMAND
;  Relink2 sourcename targetname
;
;  A minor modification to the relink command.
;      Compiles the source, writes it to the target, unlinks the target and links the
;  target file again.  A fast way to recompile/reload a macro under development from a
;  source directory to a (different) target directory/filename without leaving the
;  editor.  Note that the unlink is necessary in case the module is already linked,
;  else the link will merely reinitialize the previous version.
;
;  If an equals sign is used for the source, the current filename is assumed.
;
defc relink2
   parse arg sourcename targetname
   if sourcename = '=' then                -- If no name explicitly specified,
      p = lastpos('.', .filename)
      if upcase(substr(.filename,p))<>'.E' then
         sayerror 'Not a .E file'
         return
      endif
      sourcename = substr(.filename, 1, p-1)       -- use current file.
      if .modify then
         's'                                       -- Save it if changed.
         if rc then return; endif
      endif
   endif
 compile if EVERSION < 5
   'et' sourcename targetname
 compile else
   'etpm' sourcename targetname  -- This is the macro ETPM command.
 compile endif
   if rc then return; endif
   unlink targetname
   if RC & (RC <> -310) then sayerror RC; return; endif  -- -310 = "Unlink:  unknown module"
   link targetname
 compile if EVERSION < 5.20    -- EPM now does the sayerror internally
   if RC<0 then
      sayerror rc
   endif
 compile endif
compile endif  -- WANT_ET_COMMAND
-----cut here-----

     I simply added the code to my LINKCMDS.E file and re-compiled the
main macros.  If you want to set up a separate RELINK2.EX file, you'll
need to replace the "defc relink2" line with "defmain" before
compiling and probably remove the "compile...compile endif
--WANT_ET_COMMAND" lines. Enjoy!

So sayeth,
     Ken Arway

 
 
 

1. EPM error: Unknown command "ring_toggle"

Help:

I was wondering if anyone has an idea why I am getting this EPM error message.
There were no errors when I compiled EPM and for the most part it works fine,
but when I try to issue an EPM command like DPATH or SHELL I get this error
message:  Unknown command "ring_toggle".  My mycnf.e follows my name.

Rodney

const
ENTER_ACTION='STREAM'
C_ENTER_ACTION='ADDATEND'
P_SYNTAX_ASSIST=0
C_SYNTAX_ASSIST=0
E_SYNTAX_ASSIST=0
REXX_SYNTAX_ASSIST=0
DEFAULT_TABS=3
HOST_SUPPORT=0
WANT_BOOKMARKS=1
MY_DEFAULT_EDIT_OPTIONS='/T'
MY_DEFAULT_SEARCH_OPTIONS='C'
MY_MOUSESTYLE=2
EXTRA_EX=1
NO_ESCAPE=0
SMARTFILE=1
SMARTSAVE=1
UNDERLINE_CURSOR=1
WANT_EPM_SHELL=1
WANT_BRACKET_MATCHING=1
WANT_KEYWORD_HELP=1

2. Best High Level Language for Embedded Systems?

3. Filename "lpt7", "com1" and "nul"

4. cut/paste in popup

5. Lost "Shutdown", "Lockup" & "System Setup" Options

6. FS Sony VO5850 & controller board $2400 NY-NJ only

7. command "del *.*" from command shell

8. CP/M command similar to DOS "mode" command?

9. status = execlp("uzip4os2.exe", "c:\\in\\prot\\", "-o -j -q", zipFile);

10. "Must Have" Enhancements

11. "Inside" and "outside" mouse buttons instead of "right" and "left"?

12. No One Believes Serenity's "Boob" & "LoonyToony"