home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / programs / text / sasc_golded / scmsg_loadfile.ged < prev    next >
Text File  |  1995-02-27  |  3KB  |  85 lines

  1. /* scmsg_loadfile.ged V1.0
  2.    written in 1994 by Roland Schwingel
  3.                       Lilienthalstraße 9
  4.                       92421 Schwandorf
  5.                       Germany
  6.  
  7.    Description:
  8.    AREXX Script for SAS/C SCMSG util.
  9.    Positionates Cursor on line with an Error in any file.
  10.    Checks whether the file in which the error occured is
  11.    loaded in Golded or not. If not the file is loaded
  12.    and the cursor is positioned in the line with the error.
  13. */
  14.  
  15.  
  16. OPTIONS RESULTS                             /* enable return codes     */
  17.  
  18. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  19.     address 'GOLDED.1'
  20.  
  21. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  22. OPTIONS FAILAT 6                            /* ignore warnings         */
  23. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  24.  
  25. /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
  26.  
  27. arg arguments                               /* Filename und Zeilennummer holen */
  28.  
  29. FILENAME=WORD(arguments,1)                  /* Filename */
  30. ERRLINE=WORD(arguments,2)                   /* Zeilennummer */
  31.  
  32. LOOP=0
  33. FOUND=0
  34.  
  35. SEARCHNAME=upper(FILENAME);                 /* In Grossbuchstaben */
  36.  
  37. 'WINDOW ORDINAL 0 QUIET'                    /* Von vorne suchen */
  38. 'QUERY DOC VAR FIRSTWINNAME'                /* Dateiname holen */
  39.  
  40. WINNAME=upper(FIRSTWINNAME)                 /* In Grossbuchstaben */
  41. FIRSTWINNAME=WINNAME
  42.  
  43. /* Offene Fenster durchsuchen, ob gewünschtes mit dabei */
  44. /* Achtung: Eingefrorene Fenster werden nicht erkannt */
  45. do while (loop ~= 1)
  46.  
  47.    if (WINNAME = SEARCHNAME)
  48.    then do
  49.           LOOP=1                            /* Gefunden => abbrechen */
  50.           FOUND=1
  51.         end
  52.    else do                                  /* Nächstes suchen */
  53.         'WINDOW NEXT QUIET'
  54.         'QUERY DOC VAR WINNAME'
  55.         WINNAME=upper(WINNAME)              /* in Grossbuchstaben */
  56.         if (WINNAME = FIRSTWINNAME)
  57.         then do
  58.              LOOP=1                         /* nicht gefunden => abbrechen */
  59.              FOUND=0
  60.              end
  61.         end
  62. end
  63.  
  64. if (found = 1)
  65. then do                                     /* gefunden */
  66.      'WINDOW USE 'FILENAME''                /* Fenster aktivieren */
  67.      end
  68. else do
  69.      'OPEN NAME 'FILENAME' SMART QUIET'     /* nicht gefunden => laden */
  70.      end
  71.  
  72. 'GOTO LINE 'ERRLINE' UNFOLD TRUE'           /* Cursor auf Zeile setzen */
  73.  
  74. /* ---------------------------- END OF YOUR CODE --------------------- */
  75.  
  76. 'UNLOCK' /* VERY important: unlock GUI */
  77. EXIT
  78.  
  79. SYNTAX:
  80.  
  81. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  82. 'UNLOCK'
  83. EXIT
  84.  
  85.