[Oberon] Migrating from ETHOberon (System 3) to Blackbox
Douglas G Danforth
danforth at greenwoodfarm.com
Wed Dec 6 00:33:38 CET 2017
Dieter,
(1)Forward declarations can be used but are not necessary.
A procedure must be defined before it can be used.
(2) Arrays can be assigned.
Assignment compatible
An expression e of type Te is assignment compatible with a variable v of
type Tv if one of the following conditions hold:
1. Te and Tv are equal and neither abstract, extensible, or limited
record nor open array types;
2. Te and Tv are numeric or character types and Tv includes Te;
3. Te and Tv are pointer types and Te is an extension of Tv;
4. Tv is a pointer or a procedure type and e is NIL;
5. Tv is a numeric type and e is a constant expression whose value is
contained in Tv;
6. Tv is an array of CHAR, Te is String or Shortstring, and LEN(e) <
LEN(v);
7. Tv is an array of SHORTCHAR, Te is Shortstring, and LEN(e) < LEN(v);
8. Tv is a procedure type and e is the name of a procedure whose formal
parameters match those of Tv.
Array compatible
An actual parameter a of type Ta is array compatible with a formal
parameter f of type Tf if
1. Tf and Ta are equal types, or
2. Tf is an open array, Ta is any array, and their element types are
array compatible, or
3. Tf is an open array of CHAR and Ta is String, or
4. Tf is an open array of SHORTCHAR and Ta is Shortstring.
(3) Yes, there is a module Strings which exports
DEFINITION Strings;
CONST
charCode = -1;
decimal = 10;
digitspace = 8FX;
hexadecimal = -2;
hideBase = FALSE;
roman = -3;
showBase = TRUE;
PROCEDURE Extract (s: ARRAY OF CHAR; pos, len: INTEGER; OUT res:
ARRAY OF CHAR);
PROCEDURE Find (IN s: ARRAY OF CHAR; IN pat: ARRAY OF CHAR; start:
INTEGER; OUT pos: INTEGER);
PROCEDURE IntToString (x: LONGINT; OUT s: ARRAY OF CHAR);
PROCEDURE IntToStringForm (x: LONGINT; form, minWidth: INTEGER;
fillCh: CHAR; showBase: BOOLEAN; OUT s: ARRAY OF CHAR);
PROCEDURE IsAlpha (ch: CHAR): BOOLEAN;
PROCEDURE IsAlphaNumeric (ch: CHAR): BOOLEAN;
PROCEDURE IsIdent (ch: CHAR): BOOLEAN;
PROCEDURE IsIdentStart (ch: CHAR): BOOLEAN;
PROCEDURE IsLower (ch: CHAR): BOOLEAN;
PROCEDURE IsNumeric (ch: CHAR): BOOLEAN;
PROCEDURE IsUpper (ch: CHAR): BOOLEAN;
PROCEDURE Lower (ch: CHAR): CHAR;
PROCEDURE RealToString (x: REAL; OUT s: ARRAY OF CHAR);
PROCEDURE RealToStringForm (x: REAL; precision, minW, expW:
INTEGER; fillCh: CHAR; OUT s: ARRAY OF CHAR);
PROCEDURE Replace (VAR s: ARRAY OF CHAR; pos, len: INTEGER; IN rep:
ARRAY OF CHAR);
PROCEDURE SetToString (x: SET; OUT str: ARRAY OF CHAR);
PROCEDURE StringToInt (IN s: ARRAY OF CHAR; OUT x, res: INTEGER);
PROCEDURE StringToLInt (IN s: ARRAY OF CHAR; OUT x: LONGINT; OUT
res: INTEGER);
PROCEDURE StringToReal (IN s: ARRAY OF CHAR; OUT x: REAL; OUT res:
INTEGER);
PROCEDURE StringToSet (IN s: ARRAY OF CHAR; OUT x: SET; OUT res:
INTEGER);
PROCEDURE StringToUtf8 (IN in: ARRAY OF CHAR; OUT out: ARRAY OF
SHORTCHAR; OUT res: INTEGER);
PROCEDURE ToLower (IN in: ARRAY OF CHAR; OUT out: ARRAY OF CHAR);
PROCEDURE ToUpper (IN in: ARRAY OF CHAR; OUT out: ARRAY OF CHAR);
PROCEDURE Upper (ch: CHAR): CHAR;
PROCEDURE Utf8ToString (IN in: ARRAY OF SHORTCHAR; OUT out: ARRAY
OF CHAR; OUT res: INTEGER);
PROCEDURE Valid (IN s: ARRAY OF CHAR): BOOLEAN;
END Strings.
-Doug Danforth
On 12/5/2017 5:33 AM, Dieter wrote:
> Has anyone got experience with this topic.
>
> I uncovered a few things already:
>
> (1) Blackbox seems to want forward declarations of Procedures
> (2) The COPY command is deprecated.
> (3) Is there anything around like MODULE "Strings"?
>
> IF anybody has a more complete comparison, I would be grateful.
>
> Regards,
> Dieter
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20171205/6f652704/attachment.html>
More information about the Oberon
mailing list