[Oberon] FPGA - Oberon7 - Type Cast

Tomas Kral thomas.kral at email.cz
Tue Oct 2 21:02:47 CEST 2018

On Tue, 2 Oct 2018 18:18:21 +0200
Tomas Kral <thomas.kral at email.cz> wrote:

> How can I typecast r1:R1 to Buf?

Retyping as a pointer, I can get it in two statements.

  R1 = POINTER TO RECORD a, b, c, d: CHAR END;
  Buf = ARRAY 16 OF BYTE;
VAR buf: Buf, r1: R1;
ReadBytes(R, buf, SYSTEM.SIZE(R1)); (*1*)
r1 := SYSTEM.VAL(R1, SYSTEM.ADR(buf)); (*2*)

Tomas Kral <thomas.kral at email.cz>

More information about the Oberon mailing list