[fpc-pascal]Defining Records on the fly:

Shawn Tan Ser Ngiap shawn.tan at aeste.net
Mon Feb 16 10:46:50 CET 2004


-----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-----





More information about the fpc-pascal mailing list