Instead of making constructors and doing busy work It would be nice if Free 
Pascal could let you assign records outside of type blocks like:

rec := (x: 0; y: 0; z: 0);
you can workaround this by using typed constant for instance. Something like:

const
  DEFAULT_REC: TMyRec = (x: 0; y: 0; z: 0 );
var
  rec: TMyRec;
begin
  rec := DEFAULT_REC; // or rec := Default(TMyRec) if you want zeroes
  ...

L.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to