home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6571.LZX / extras / ttx / rexx / ttx_sasc / Compile.ttx < prev    next >
Encoding:
Text File  |  1996-12-24  |  849 b   |  37 lines

  1. /*
  2. **  $VER: Compile.ttx 2.1 (17.8.93)
  3. **      By Kenneth Yarnall.  This code may be freely distributed
  4. **
  5. **  Compile.ttx makes sure that there is a current file, and then
  6. ** compiles it via sc using an "on-the-fly" shell script.  It also
  7. ** starts SCmsg.
  8. **
  9. */
  10.  
  11. Options RESULTS
  12.  
  13. /* Get the current screen name from TTX, to use when opening SCMsg */
  14.  
  15. GetScreenInfo
  16. Parse VAR RESULT . '"' pubscrname '"'
  17.  
  18. fullname = 'Rexx:TTX_SASC/SafeGetFileName'()
  19.  
  20. path = 'Rexx:TTX_SASC/GetPathPart'(fullname)
  21. name = 'Rexx:TTX_SASC/GetFilePart'(fullname)
  22.  
  23. Call 'Rexx:TTX_SASC/StartSCMsg.ttx' pubscrname
  24.  
  25. /*
  26. **  Build an "On the fly script" and execute it to compile.
  27. */
  28.  
  29. conspec = 'con:20/20/600/200/SC/SCREEN' || pubscrname
  30.  
  31. Address 'COMMAND'
  32. 'run cd ' || path || ' +' || '0A'X,
  33.     || 'sc >' || conspec || ' ' || name || ' +' || '0A'X,
  34.     || 'Wait 5'
  35.  
  36. exit 0