[Oberon] Printing an array

Christian Demmer chris at gcjd.de-web.ws
Tue Oct 7 23:28:35 MEST 2008


Martin Bishop wrote:
>PROCEDURE PrintArray(VAR a: ARRAY OF INTEGER);
>   VAR i: INTEGER;
>BEGIN
>   FOR i := 0 TO LEN(a) - 1 DO
>      Out.Int(a[i], 0);
>      Out.String(" ");
>   END;
>END PrintArray;

That appears correct to me and my compiler. Which Compiler do you use?
OOC?

>/home/martin/code/Oberon/Bogo.Mod:32:30: Expression not compatible with
>variable type `INTEGER'

Assuming that 32:30 means line 32 pos 30 please show us the complete
code and location of the error.

>Which I assume means LEN can't get the length of a?

I don't think so.

Greetings, Christian


More information about the Oberon mailing list