[fpc-pascal]Defining Records on the fly:

Jon D. Sawyer badquanta6384 at comcast.net
Wed Feb 18 02:04:39 CET 2004


Here is why I was wondering why you couldn't, say I have this type:
Type tMyRec = Record X, Y : Real; End;

And I have this function:

Function CheckPoint(aPoint: tMyRec): Boolean;
Begin
  {Does something here..}
end;

begin
  CheckPoint((X:1.2;Y:2.2));
end.

In short I think it would be a nifty feature.. but hey.. I was just
wondering.

On Mon, 2004-02-16 at 04:46, Shawn Tan Ser Ngiap wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Monday 16 February 2004 00:40, Jon D. Sawyer wrote:
> 
> > Const ARec : tMyRec = (X:12; Y:25);
> >
> > why can't I do this?
> >
> > var
> >   AnotherRec: tMyRec;
> > begin
> >   AnotherRec := (X:12; Y:25);
> 
> It's just the way the language is... you could do this...
> 
> AnotherRec.X := 12;
> AnotherRec.Y := 25;
> 
> or this, if i'm not mistaken...
> 
> with AnotherRec do begin
> 	X := 12;
> 	Y := 25;
> end;
> 
> with metta,
> Shawn Tan.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
> 
> iD8DBQFAMJGK9KUEj/m6O5oRAgFLAJ9P8GoTc62l310Zq99F1g6RujOuwgCgsdc7
> liXNcgoLQIPREr7BbN0lG6c=
> =u2G5
> -----END PGP SIGNATURE-----
> 
> 
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal





More information about the fpc-pascal mailing list