[Oberon] Dynamically sized allocation with NEW()

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Tue Jan 15 19:10:05 CET 2019


   > TYPE
   >    Buf = RECORD raster: ARRAY N0 OF BYTE END ;
   >    Buf16 = RECORD(Buf) ext16: ARRAY N16 OF BYTE END ;    (*extension - just like Fonts.LargeFont is an extension of Fonts.Font*)
   >    Buf32 = RECORD(Buf) ext32: ARRAY N32 OF BYTE END ;
   >    …
   >  VAR
   >    buf: Buf; buf16: Buf16; buf32: Buf32; …
   >    …

in fact, the variables should all be pointers to records of course + Buf32 may even be an extension of Buf 16 … 

but you get the idea …



More information about the Oberon mailing list