[Oberon] SystemV- Heap + Module Space
Chris Burrows
chris at cfbsoftware.com
Sun Jan 6 00:02:03 CET 2019
> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
> Andreas Pirklbauer
> Sent: Sunday, 6 January 2019 3:34 AM
> To: ETH Oberon and related systems
> Subject: [Oberon] SystemV- Heap + Module Space
>
> > Oberon.Activate(): even better with a CASE??
>
> Ok, so.. for those who use an Oberon compiler, which implements the
> numeric CASE statement ??
>
> PROCEDURE Activate*(F: Viewers.Frame; T: Texts.Text; pos: LONGINT);
> (*command*)
If possible, the logic that maps error codes onto error messages should be located in the module where the error codes are defined. Then the client call could be just:
SetPar(F, T, pos + S.len); Call(S.s, Mname, Cname, res);
IF (res # Modules.noerr) & (Log # NIL) THEN Texts.WriteString(W, "Call error: ");
Modules.GetErrorMsg(res, msg);
Texts.WriteString(msg);
Texts.WriteLn(W); Texts.Append(Log, W.buf)
END
The CASE statement is contained in Modules.GetErrorMsg and the non-standard ELSE in the CASE statement is redundant.
If all error codes have the same end result in the clients, then you only need to export Modules.noerr.
Chris.
More information about the Oberon
mailing list