home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / text / edit / macro / amigae / ec_profiler.rexx < prev    next >
OS/2 REXX Batch file  |  1994-10-10  |  2KB  |  50 lines

  1. /* $VER: 1.0, ©1994 BURGHARD Eric.                  */
  2. /*          Profile with current file               */
  3.  
  4. options results                             /* enable return codes     */
  5.                                             /* not started by GoldEd ? */
  6. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then address 'GOLDED.1'
  7. 'LOCK CURRENT QUIET'                        /* lock GUI, gain access   */
  8. if rc then exit
  9. options failat 6                            /* ignore warnings         */
  10. signal on syntax                            /* ensure clean exit       */
  11.  
  12. 'QUERY FILE PATH USER1 ANYTEXT'
  13. parse var result name ' ' path ' ' optcdisk ' ' anytext
  14. if (anytext="TRUE") then do
  15.   if upper(right(name,2))='.E' then do
  16.     name=left(name,length(name)-2)
  17.     optname=name
  18.     if optcdisk="TRUE" then do
  19.       if right(path,1)~=":" then path=''path'/'
  20.       name=''path''name''
  21.     end
  22.     else name='T:E/'name''
  23.     if exists(name) then do
  24.       if exists('ENV:ECopt') then do
  25.         ok = open(filehandle,'ENV:ECOpt','read')
  26.         ecopt=readln(filehandle)
  27.         ok = close(filehandle)
  28.         if (find(ecopt,'SYM')~=0 | find(ecopt,'LINEDEBUG')~=0) then do
  29.           options failat 101
  30.           address command 'EDEVICE:AProf 'name''
  31.           options failat 10
  32.         end
  33.         else 'REQUEST STATUS=" Recompile with SYMBOLS and/or LINEDEBUG"'
  34.       end
  35.       else 'REQUEST STATUS=" Recompile with SYMBOLS and/or LINEDEBUG"'
  36.     end
  37.     else 'REQUEST STATUS=" File has not been compiled !"'
  38.   end
  39.   else 'REQUEST STATUS=" But.. E Sources names ends with '.e' ?!"'
  40. end
  41. else 'REQUEST STATUS=" Text buffer is empty ?!"'
  42. 'UNLOCK'
  43. exit
  44.  
  45. syntax:
  46. say "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  47. 'UNLOCK'
  48. exit
  49.  
  50.