<> <> <> <<>> DIRECTORY IO, MessageWindow, Rope, SVError; SVErrorImpl: CEDAR PROGRAM IMPORTS IO, MessageWindow EXPORTS SVError = BEGIN <> <<>> gErrorStream: IO.STREAM; Problem: PUBLIC SIGNAL [msg: Rope.ROPE] = CODE; MsgType: TYPE = SVError.MsgType; -- {oneLiner, begin, middle, end}; SetErrorStream: PUBLIC PROC [errorStream: IO.STREAM] = { gErrorStream _ errorStream; }; GetErrorStream: PUBLIC PROC [] RETURNS [errorStream: IO.STREAM] = { RETURN[gErrorStream]; }; Blink: PUBLIC PROC [] = { MessageWindow.Blink[]; }; Append: PUBLIC PROC [msg: Rope.ROPE, msgType: MsgType] = { clearHerald: BOOL _ msgType = begin OR msgType = oneLiner; MessageWindow.Append[msg, clearHerald]; gErrorStream.PutF[msg]; IF msgType = oneLiner OR msgType = end THEN gErrorStream.PutChar[IO.CR]; }; AppendHerald: PUBLIC PROC [msg: Rope.ROPE, msgType: MsgType] = { clearHerald: BOOL _ msgType = begin OR msgType = oneLiner; MessageWindow.Append[msg, clearHerald]; }; AppendTypescript: PUBLIC PROC [msg: Rope.ROPE, msgType: MsgType] = { gErrorStream.PutF[msg]; IF msgType = oneLiner OR msgType = end THEN gErrorStream.PutChar[IO.CR]; }; PutF: PUBLIC PROC [msgType: MsgType, format: Rope.ROPE _ NIL, v1, v2, v3, v4, v5: IO.Value _ [null[]] ] = { -- to script and feedback line msg: Rope.ROPE _ IO.PutFR[format, v1, v2, v3, v4, v5]; Append[msg, msgType]; }; PutFHerald: PUBLIC PROC [msgType: MsgType, format: Rope.ROPE _ NIL, v1, v2, v3, v4, v5: IO.Value _ [null[]] ] = { -- to feedback line only msg: Rope.ROPE _ IO.PutFR[format, v1, v2, v3, v4, v5]; AppendHerald[msg, msgType]; }; PutFTypescript: PUBLIC PROC [msgType: MsgType, format: Rope.ROPE _ NIL, v1, v2, v3, v4, v5: IO.Value _ [null[]] ] = { -- to script only msg: Rope.ROPE _ IO.PutFR[format, v1, v2, v3, v4, v5]; AppendTypescript[msg, msgType]; }; NotYetImplemented: PUBLIC SIGNAL = CODE; END.