[Oberon] Bug in Utilities.Buffer.Add

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


Folk,

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);
        VAR
            i: INTEGER;
            b, res: LONGINT;
            s: ARRAY 4 OF CHAR;
        BEGIN
            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);
            END;
            Add (s, 0, len, TRUE, res)
        END AddInt;

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

-- 
Cheers, SAGE
http://sage.h15.ru/



More information about the Oberon mailing list