home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / OB3.2D2.DMS / in.adf / ObSup_Scripts / TurboText / rexx / Err.ttx < prev    next >
Encoding:
Text File  |  1992-08-01  |  2.7 KB  |  113 lines

  1. /* ------------------------------------------------------------------------
  2.   :Program.       Err.ttx
  3.   :Contents.      Show Oberon errors with Turbotext
  4.   :Author.        Kai Bolay [kai]
  5.   :Address.       Snail-Mail:              E-Mail:
  6.   :Address.       Hoffmannstrasse 168      UUCP: kai@amokle.adsp.sub.org
  7.   :Address.       D-7250 Leonberg 1        FIDO: 2:247/706.3
  8.   :Author.        Jan Geißler [jan] (Turbotext-Anpassung)
  9.   :Address.       Snail-Mail:              E-Mail:
  10.   :Address.       Hermann-Rombach-Str. 17  Zerberus:J.GEISSLER@DALLAS.ZER
  11.   :Address.       D-7120 Bietigheim        FIDO: 2:247/706.5
  12.   :History.       v1.0 [kai] 12-Mar-92
  13.   :History.       v1.0.1 [jan] 06-Jun-92 (+ fixed for use with TurboText)
  14.   :Copyright.     FD
  15.   :Language.      ARexx
  16.   :Translator.    RexxMast
  17.   :Remark.        Use AmigaOberon.dfn to get oberon menus & more in TTX!
  18. ------------------------------------------------------------------------ */
  19.  
  20. /*** Open oberonsupport.library ***/
  21.  
  22. options results
  23.  
  24. arg what
  25. if (what ~= "FIRST") & (what ~= "NEXT") & (what ~= "PREV") then do
  26.   requestbool "Fehler" "Falscher Aufruf von Err.ttx"
  27.   BeepScreen
  28.   exit
  29. end
  30.  
  31. libname = "oberonsupport.library"
  32.  
  33. if ~show("L", libname) then do
  34.   if ~addlib(libname, 0, -30, 1) then do
  35.     text = libname "not found!"
  36.     BeepScreen
  37.     RequestBool "Fehler:" text
  38.   end
  39. end
  40.  
  41. getfileinfo /* Nur Filnamen (ohne Pfad) holen */
  42. parse var result unw1 unw2 filename
  43.  
  44. if filename = "" then do
  45.   BeepScreen
  46.   RequestBool "Fehler:" "Kein Filename"
  47.   exit
  48. end
  49.  
  50. getfilepath /* Kompletten Filenamen (mit Pfad) holen */
  51. filename = result
  52.  
  53. if right(filename,4) ~= ".mod" then do
  54.   BeepScreen
  55.   RequestBool "Fehler:" "Filename endet nicht auf '.mod'"
  56.   exit
  57. end
  58.  
  59. filename = filename || 'E'
  60.  
  61. count = GetErrCount(filename)
  62. if count < 0 then do
  63.   BeepScreen
  64.   RequestBool "Fehler:" "Kann Fehleranzahl nicht bestimmen"
  65.   exit
  66. end
  67.  
  68. if what = "FIRST" then do
  69.   cnt = 0
  70. end; else do
  71.   cnt = getclip("CurrentError")
  72.  
  73.   if cnt = "" then do
  74.     BeepScreen
  75.     RequestBool "Fehler:" "Kann mir aktuellen Fehler nicht holen"
  76.     exit
  77.   end
  78.  
  79.   if what = "NEXT" then do
  80.     cnt = cnt+1
  81.   end; else do
  82.     cnt = cnt-1
  83.   end
  84. end
  85.  
  86. if cnt >= count then do
  87.   SetStatusBar "Keine weiteren Fehler"
  88.   exit
  89. end
  90.  
  91. if cnt < 0 then do
  92.   SetStatusBar "Erster Fehler bereits erreicht"
  93.   exit
  94. end
  95.  
  96. if ~GetError(filename, cnt, Error.) then do
  97.   BeepScreen
  98.   RequestBool "Fehler:" "Kann Fehlerdatei nicht laden"
  99.   exit
  100. end
  101.  
  102. move FOLDS Error.line Error.column-1
  103.  
  104. text = "F." cnt+1 || "/" || count || ": " || GetErrorText(Error.num)
  105.  
  106. SetStatusBar text
  107.  
  108. if ~setclip("CurrentError",cnt) then do
  109.   BeepScreen
  110.   RequestBool "Fehler:" "Kann mir aktuellen Fehler nicht merken"
  111.   exit
  112. end
  113.