[Oberon] FPGA - OberonV4 Dialogs

Tomas Kral thomas.kral at email.cz
Thu Nov 29 14:49:16 CET 2018


> PROCEDURE LoadP (p: Panel; VAR r: Files.Rider);
> 	(** reads the panel from rider r *)
> BEGIN
> 	...
> 	WHILE V{elements-count} > 0 DO
> 		P{Get Module Name} 
> 		P{Load Name}
> 		P{Init Module with Dlg data} 
> 	END ;
> DONE.

Doing away without `Types.Mod', the code skeleton shows what I am
trying to achieve, but I still miss some parts of types, and how to
get to their pointers at run time?

MODULE TLoader; (* TK  29.11.2018 RISC type init loader *)
  IMPORT In, Out, Modules;

  TYPE T0 = INTEGER (*address*); T1 = INTEGER (*address*);
  
  PROCEDURE Run*;
    VAR name: Modules.ModuleName; module: Modules.Module; typeOf: PROCEDURE;
  BEGIN In.Open; In.Name(name);
    WHILE In.Done DO
      Out.String(name); Out.String(" loading ");
      Modules.Load(name, module);
      typeOf := Modules.ThisCommand(module, "Type");
      IF Modules.res = 0 THEN typeOf END ;
      In.Name(name); Out.Ln
    END;
  END Run;

BEGIN
END TLoader.

TLoader.Run M0 M1 ~


MODULE M0;
  IMPORT Out;
  TYPE T0* = RECORD END;

  PROCEDURE Type*; BEGIN Out.String("T0") END Type;

BEGIN
END M0.


MODULE M1;
  IMPORT M0, Out;
  TYPE T1* = RECORD(M0.T0) END;

  PROCEDURE Type*; BEGIN Out.String("T1") END Type;

BEGIN
END M1.


-- 
Tomas Kral <thomas.kral at email.cz>


More information about the Oberon mailing list