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

  1. /* 
  2.  * $VER: scmsg.ged 1.0 (19.07.94)
  3.  * ©1994 Markus Zahn (Zahn@Uni-Augsburg.DE)
  4.  * Retrieve next error/warning message using SAS/C 6.50
  5.  *
  6.  * Notes:
  7.  *
  8.  * Your env:sc/SCMSG file should contain lines that look something
  9.  * like the following to work with GoldED:
  10.  *
  11.  *   PORTNAME GOLDED.1
  12.  *   EDITCOMMAND GED "%f"
  13.  *   GOTOFILE WINDOW USE="%f" FORCE
  14.  *   GOTOLINE GOTO LINE %l UNFOLD=TRUE
  15.  *   PUBSCREEN GOLDED.1
  16.  *
  17.  * Your env:sc/SCOPTIONS file should contain the following line:
  18.  *
  19.  *   ERRORREXX
  20.  */
  21.  
  22. OPTIONS RESULTS                             /* enable return codes     */
  23.  
  24. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  25.     address 'GOLDED.1'
  26.  
  27. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  28. OPTIONS FAILAT 21                           /* ignore warnings         */
  29. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  30.  
  31.  
  32. /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
  33.  
  34. 'QUERY CAT'
  35. isGerman = ( result = "deutsch" )
  36.  
  37. if( ~show( ports, SC_SCMSG ) ) then
  38. do
  39.   address command 'run <nil: >nil: sc:c/scmsg'
  40.   address command 'waitforport SC_SCMSG'
  41. end
  42.  
  43. address SC_SCMSG 'file'
  44. file = result
  45. if( result = '' ) then
  46. do
  47.   if( isGerman ) then
  48.     'REQUEST BODY="Keine (weiteren) errors/warnings!"'
  49.   else
  50.     'REQUEST BODY="No (more) errors/warnings!"'
  51. end
  52. else
  53. do
  54.   address SC_SCMSG 'line'
  55.   line = result
  56.   address SC_SCMSG 'class'
  57.   class = result
  58.   address SC_SCMSG 'text'
  59.   message = class || ': ' || result
  60.   address SC_SCMSG 'altfile'
  61.   altfile = result
  62.  
  63.   'FIX VAR MESSAGE'
  64.  
  65.   if( altfile ~= '' ) then
  66.   do
  67.     address SC_SCMSG 'altline'
  68.     altline = result
  69.  
  70.     'WINDOW USE="' || altfile || '" FORCE'
  71.     'GOTO LINE=' || altline || ' UNFOLD=TRUE'
  72.     'REQUEST STATUS="' || message || '"'
  73.   end
  74.  
  75.   'WINDOW USE="' || file || '" FORCE'
  76.   'GOTO LINE=' || line || ' UNFOLD=TRUE'
  77.   'REQUEST STATUS="' || message || '"'
  78.  
  79.   address SC_SCMSG 'delete'
  80. end
  81.  
  82. /* ---------------------------- END OF YOUR CODE --------------------- */
  83.  
  84. 'UNLOCK' /* VERY important: unlock GUI */
  85. EXIT
  86.  
  87. SYNTAX:
  88.  
  89. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  90. 'UNLOCK'
  91. EXIT
  92.