File: GGErrorImpl.mesa
Last edited by: Eric Bier on July 28, 1985 12:44:00 pm PDT
Contents: Routines for handling user error messages throughout Gargoyle.
DIRECTORY
IO,
MessageWindow,
Rope,
GGError;
GGErrorImpl:
CEDAR
PROGRAM
IMPORTS IO, MessageWindow
EXPORTS GGError =
BEGIN
MsgType: TYPE = GGError.MsgType;
Global Variables
gErrorStream: IO.STREAM;
SetErrorStream:
PUBLIC
PROC [errorStream:
IO.
STREAM] =
CHECKED {
gErrorStream ← errorStream;
};
GetErrorStream:
PUBLIC
PROC []
RETURNS [errorStream:
IO.
STREAM] =
CHECKED {
RETURN[gErrorStream];
};
Append:
PUBLIC
PROC [msg: Rope.
ROPE, msgType: MsgType] =
CHECKED {
clearHerald, addCR: BOOL;
clearHerald ← msgType = oneLiner OR msgType = begin;
addCR ← msgType = oneLiner OR msgType = end;
MessageWindow.Append[msg, clearHerald];
IF gErrorStream #
NIL
THEN {
gErrorStream.PutF[msg];
IF addCR THEN gErrorStream.PutChar[IO.CR];
};
};
AppendHerald:
PUBLIC
PROC [msg: Rope.
ROPE, clearHerald:
BOOL] =
CHECKED {
MessageWindow.Append[msg, clearHerald];
};
AppendTypescript:
PUBLIC
PROC [msg: Rope.
ROPE] =
CHECKED {
IF gErrorStream #
NIL
THEN {
gErrorStream.PutF[msg];
gErrorStream.PutChar[IO.CR];
};
};
Blink:
PUBLIC
PROC [] =
CHECKED {
MessageWindow.Blink[];
};
NotYetImplemented: PUBLIC SIGNAL = CODE;
END.