home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Editor / Edge1721.DMS / Edge1721.adf / ExtraStuff / Edge_SasC.lha / rexx / hn_compilesettings.edge < prev    next >
Encoding:
Text File  |  1993-11-09  |  1.9 KB  |  78 lines

  1. /* Edge macro: hn_compilesettings
  2. **
  3. ** $VER: hn_compilesettings.edge 1.0 (16-Feb-93 00:15:52)
  4. **
  5. ** Usage:    hn_compileoptions [COMPILER|OUTDIR|LINK|ARGUMENTS]
  6. **
  7. ** Synopsis: Change settings for hn_compile
  8. **
  9. ** Author:   Henrik Nordström
  10. **           Ängsvägen 1
  11. **           S 756 45 Uppsala
  12. */
  13.  
  14. options results
  15.  
  16. parse upper arg mode
  17.  
  18. 'getenvvar _fe_user8 RAW'
  19. settings=replacestar(result)
  20. parse var settings compilerflags ',' linkoptions ',' outdir ',' arguments
  21.  
  22. select
  23. when mode='COMPILER' then do
  24.   'requeststring title "Compiler flags?" default "'compilerflags'"'
  25.   ret=RC
  26.   compilerflags=replacestar(RESULT)
  27.   end
  28. when mode='OUTDIR' then do
  29.   'getenvvar _fe_path'    /* Get file path */
  30.   filepath=result
  31.   'currentdir "'filepath'"' /* And set it as working directory */
  32.   oldcurdir=result;
  33.   /* Request new output directory */
  34.   'requestfile TITLE "Compiler output directory?" PATH "'outdir'" DIR GETDIR'
  35.   ret=RC
  36.   outdir=RESULT
  37.   if ret~=0 then exit(ret)
  38.   'currentdir "'oldcurdir'"' /* Restore working directory */
  39.   if outdir~='' then do 
  40.     /* Make path absolute */
  41.     call pragma('d',filepath);
  42.     call pragma('d',outdir)
  43.     outdir=pragma(d)
  44.     if right(outdir,1)~=':' then
  45.       outdir=outdir||'/'
  46.     end
  47.   end
  48. when mode='LINK' then do
  49.   'requeststring title "BLink options? ($**=obj $@=name)" default "'linkoptions'"'
  50.   ret=RC
  51.   linkoptions=replacestar(RESULT)
  52.   end
  53. when mode='ARGUMENTS' then do
  54.   'requeststring title "Command arguments?" default "'arguments'"'
  55.   ret=RC
  56.   arguments=replacestar(RESULT);
  57.   end
  58. otherwise do
  59.   say 'MODE: "'mode'" unknown'
  60.   say 'USAGE: hn_compilesettings [COMPILER|OUTDIR|LINK|ARGUMENTS]' 
  61.   exit(10)
  62.   end
  63. end
  64.  
  65. if ret=0 then 'putenvvar _fe_user8 "'compilerflags','linkoptions','outdir','arguments'"'
  66.  
  67. exit(ret)
  68.  
  69. /* Replace * with ** */
  70. replacestar: procedure
  71. str=arg(1)
  72. i=index(str,'*',1)
  73. do while i>0
  74.     str=insert('*',str,i)
  75.    i=index(str,'*',i+2)
  76. end
  77. return str
  78.