home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / text / edit / macro / sas / sc.ged < prev    next >
Text File  |  1994-07-19  |  2KB  |  80 lines

  1. /* 
  2.  * $VER: sc.ged 1.0 (19.07.94)
  3.  * ©1994 Markus Zahn (Zahn@Uni-Augsburg.DE)
  4.  * Compile current file using SAS/C 6.50
  5.  *
  6.  * Note:
  7.  *
  8.  * Be careful with the AUTOEDIT option in env:sc/SCMSG, i.e. don't
  9.  * use it. The GoldED GUI only gets unlocked, when you close the
  10.  * compiler output window. Use the scmsg.ged script to retrieve your
  11.  * errors/warnings instead!
  12.  */
  13.  
  14. OPTIONS RESULTS                             /* enable return codes     */
  15.  
  16. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  17.     address 'GOLDED.1'
  18.  
  19. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  20. OPTIONS FAILAT 21                           /* ignore warnings         */
  21. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  22.  
  23. /* ------------------------- INSERT YOUR CODE HERE: ------------------ */
  24.  
  25. 'QUERY CAT'
  26. isGerman = (result = "deutsch")
  27.  
  28. 'QUERY MODIFY'
  29. if( result = 'TRUE' ) then
  30. do
  31.   if( isGerman ) then
  32.     'REQUEST BODY="Datei wurde verändert. Speichern?" BUTTON="Speichern|Abbrechen"'
  33.   else
  34.     'REQUEST BODY="File has been changed. Save it?" BUTTON="SAVE|CANCEL"'
  35.  
  36.   if( result = 1 ) then
  37.     'SAVE ALL'
  38. end
  39.  
  40. 'QUERY ANYTEXT' /* any text loaded? */
  41. if( result = 'TRUE' ) then
  42. do
  43.   'QUERY FILE VAR FILENAME' /* get current filename */
  44.   'QUERY PATH VAR PATH' /* get path of current file */
  45.  
  46.   shell /* address shell */
  47.  
  48.   dir = pragma( 'directory', path ) /* goto directory of current file */
  49.   'sc:c/sc ' || filename /* compile current file */
  50.   path = pragma( 'directory', dir ) /* go back to original directory */
  51.   say
  52.  
  53.   shell /* address host (GoldED) */
  54.  
  55.   if( isGerman ) then
  56.     say "Fertig (RETURN drücken)."
  57.   else
  58.     say "Done (press RETURN)."
  59.   pull dummy
  60. end
  61. else
  62. do
  63.   if( isGerman ) then
  64.     'REQUEST BODY="Kein Text vorhanden!?"'
  65.   else
  66.     'REQUEST BODY="Text buffer is empty!?"'
  67. end
  68.  
  69. /* ---------------------------- END OF YOUR CODE ----------------------- */
  70.  
  71. 'UNLOCK' /* VERY important: unlock GUI */
  72. EXIT
  73.  
  74. SYNTAX:
  75.  
  76. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  77. 'UNLOCK'
  78. EXIT
  79.  
  80.