Initialized record fields_(re)

Sat, 21 Jun 1997 00:06:41 +0200 (MET DST)


According to The African Chief:
> 
> It seems that one cannot have record fields pre-initialised to
> certain values (or am I missing something?) [...]

True.  I agree that initalized record fields would be nice.
(What does The Standard say about this, BTW?)

However you can initialize the whole record, like type constants in BP ...
testing it ... uh - sorry, it does not work in fact!  :-(

The following should work:

   Var
     R: record
       foo: Integer;
       bar: Char;
     end (* R *) value ( foo: 42; bar: 'G' );

or, alternatively

   Var
     R: record
       foo: Integer;
       bar: Char;
     end (* R *) value ( 42, 'G' );

Thanks for the bug report!

    Peter

 Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer
peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201]
 maintainer GNU Pascal [970510] - http://home.pages.de/~gnu-pascal/ [970125]


Peter Gerwinski (peter@agnes.dida.physik.uni-essen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es