/* ------------------------------------------------------------------------ :Program. OErr.ced :Contents. Show Oberon error with CygnusEd Professional :Author. Franz Schwarz :Copyright. Public Domain :History. v1.0 [fSchwwarz] :Version. $VER: Options 1.0 (25.6.93) :Language. ARexx :Translator. RexxMast :Support. Original program skeleton by Kai Bolay ------------------------------------------------------------------------ */ options results address 'rexx_ced' status 21 /* filename */ clipname = "CurrOErr" || result arg what if (what ~= "FIRST") & (what ~= "NEXT") & (what ~= "PREV") & (what ~= "CLEAR") & (what ~= "CURRENT") then do Okay1 "Fehler: Falscher Aufruf!" exit end libname='oberonsupport.library' if ~show('l',libname) then if ~addlib(libname,0,-30) then do 'Okay1 No 'libname'!' exit end status 21 /* Nur Filnamen (ohne Pfad) holen */ filename = result if filename = "" then do Okay1 "Fehler: Kein Filename" exit end status 19 /* Kompletten Filenamen (mit Pfad) holen */ filename = result if upper(right(filename,4)) ~= ".MOD" then do Okay1 "Fehler: Filename endet nicht auf '.mod'" exit end if what = "CLEAR" then do call setclip clipname exit end filename = filename || 'E' if ~ReadErrorFile(filename, 'ALLERRS.') then do Okay1 "Fehler: Kann Fehleranzahl nicht bestimmen" exit end count = allerrs.count if count < 0 then do Okay1 "Fehler: Kann Fehleranzahl nicht bestimmen" exit end status 47 curpos.line = result+1 status 46 curpos.column = result+2 clip = getclip(clipname) cnt = clip if cnt = "" then cnt = 0 if ~GetError(filename, cnt, 'CURERR.') then do Okay1 "Fehler: Kann Fehlerdatei nicht laden" exit end select when what = "FIRST" then do cnt = 0 clip = -1 end; when what = "CURRENT" then nop when what = "NEXT" then do do i=0 to count-1 if ~GetError(filename, i, 'ERROR.') then do Okay1 "Fehler: Kann Fehlerdatei nicht laden" exit end if error.line=i then iterate end leave end cnt=min(count-1, i) end when what = "PREV" then do do i=count-1 to 0 by -1 if ~GetError(filename, i, 'ERROR.') then do Okay1 "Fehler: Kann Fehlerdatei nicht laden" exit end if error.line>curpos.line then iterate if error.line=curpos.line then do if error.column>curpos.column then iterate if error.column=curpos.column then if curerr.line=error.line & curerr.column=error.column & cnt<=i then iterate end leave end cnt=max(0, i) end end select when cnt = clip then intro = "Nochmal " otherwise intro = "" end if ~GetError(filename, cnt, 'ERROR.') then do Okay1 "Fehler: Kann Fehlerdatei nicht laden" exit end jumpto Error.line Error.column-1 text = intro || "Fehler Nr." cnt+1 "von" count || ":" || '0A'X || GetErrorText(Error.num) Okay1 text if ~setclip(clipname, cnt) then do Okay1 "Fehler: Kann mir aktuellen Fehler nicht merken" exit end exit GetError: if arg()~=3 | arg(2)>=allerrs.count | arg(2)<0 then return 0 interpret ''arg(3)'num = allerrs.'arg(2)'.num;', arg(3)'line = allerrs.'arg(2)'.line;', arg(3)'column = allerrs.'arg(2)'.column' return 1