[Oberon] Bug in Utilities.Buffer.Add

Yaroslav Romanchenko tobject at bk.ru
Sat Mar 17 18:31:03 MET 2007


In "Utilities.Buffer.Add" TRAP happens when "buf" has more data than
"LEN(data) * 2".

And maybe will be useful to have in Buffer object methods which allows
adding integers in LittleEndian.
Something like that:
        PROCEDURE AddInt* (n, len: LONGINT);
            i: INTEGER;
            b, res: LONGINT;
            s: ARRAY 4 OF CHAR;
            ASSERT (len <= 4);
            i := 0; b := 1;
            WHILE i < len DO
                s[i] := CHR (BIT.LAND ((n DIV b), 0FFH));
                b := b * 100H;
                INC (i);
            Add (s, 0, len, TRUE, res)
        END AddInt;

Or BB has standard procedures for such operations excluding using of
module SYSTEM?

Cheers, SAGE

More information about the Oberon mailing list