[Oberon] SystemV- Heap + Module Space
Andreas Pirklbauer
andreas_pirklbauer at yahoo.com
Sat Jan 5 18:04:13 CET 2019
> 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*)
VAR S: Texts.Scanner; res: INTEGER;
Mname, Cname: ARRAY 32 OF CHAR;
BEGIN
Texts.OpenScanner(S, T, pos); Texts.Scan(S);
IF ((S.class = Texts.Name) OR (S.class = Texts.String)) & (S.line = 0) THEN (*strings allowed*)
SetPar(F, T, pos + S.len); Call(S.s, Mname, Cname, res);
IF (res # Modules.noerr) & (Log # NIL) THEN Texts.WriteString(W, "Call error: ");
CASE res OF
| Modules.nofile: Texts.WriteString(W, Modules.importing); Texts.WriteString(W, " module not found")
| Modules.badversion: Texts.WriteString(W, Modules.importing); Texts.WriteString(W, " bad version")
| Modules.badkey: Texts.WriteString(W, Modules.importing); Texts.WriteString(W, " imports ");
Texts.WriteString(W, Modules.imported); Texts.WriteString(W, " with bad key")
| Modules.badfile: Texts.WriteString(W, Modules.importing); Texts.WriteString(W, " corrupted obj file")
| Modules.nocmd: Texts.WriteString(W, Mname); Texts.WriteString(W, " command not found")
| Modules.badcmd: Texts.WriteString(W, S.s); Texts.WriteString(W, " invalid command")
| Modules.nospace: Texts.WriteString(W, Modules.importing); Texts.WriteString(W, " insufficient space")
| Modules.nomod: Texts.WriteString(W, Mname); Texts.WriteString(W, " module not found")
ELSE Texts.WriteString(W, " unknown error"); Texts.WriteInt(W, res, 3)
END ;
Texts.WriteLn(W); Texts.Append(Log, W.buf)
END
END
END Activate;
More information about the Oberon
mailing list