home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / snma / arexx / geterr.xdme < prev    next >
Text File  |  1977-12-31  |  1KB  |  54 lines

  1. /*        GetErr.xdme
  2.     Get the error of the SNMA assembly and goto to the line
  3.     where error is and display error descriptor in title bar
  4.     Template: GetErr [ErrNum]
  5.  
  6.     If there is no ErrNum then the Next error is fetched
  7.  
  8. */
  9.  
  10. arg num     /* fetch error number. If omitted, it is '' */
  11.  
  12. /*  make sure we have SNMA port */
  13.  
  14. xdme_add = address()
  15. snma_port = SNMA
  16. do while ~ show('p',snma_port)
  17.     "title (Cannot find port named" snma_port
  18.     exit 20
  19.     end
  20.  
  21. /* do the actual job */
  22.  
  23. address SNMA
  24. INFO A
  25. if A.ERRORS = 0 then do
  26.     address value xdme_add
  27.     "title (SNMA: No Errors)"
  28.     end
  29. else do
  30.     "GETERR STEM E" num
  31.     address value xdme_add
  32.     options results
  33.     'rxresult $fname'           /* fetch filename , make it BIGGGGG!*/
  34.     res=upper(result)
  35.  
  36.     if E.FILENAME = res then do
  37.     /* error is in this file */
  38.     "title ("E.ERRNUM"/"A.ERRORS ":"E.ERRTXT", line:" E.LINENUM
  39.     if E.LINENUM ~= 0 then do
  40.        "goto" E.LINENUM
  41.        "col" E.COLUMN
  42.     end
  43.     end
  44.     else do
  45.     if E.FILENAME='user macro' then do
  46.         "title ("E.ERRNUM"/"A.ERRORS ":"E.ERRTXT", line:" E.LINENUM " in user macro"
  47.     end
  48.     else do /* error is in the other file (include file) */
  49.        "title ("E.ERRNUM"/"A.ERRORS "in file" E.FILENAME "line" E.LINENUM "," E.ERRTXT
  50.     end
  51.     end
  52. end
  53.  
  54.