[fpc-pascal] Default record const values

Ryan Joseph ryan at thealchemistguild.com
Sat Nov 10 09:35:00 CET 2018


Should’t this work? This would be a good way to set default record values but it doesn’t seem to be supported.


type
	TMyRecord = record
		public
			a: integer;
			b: string;
		const
			default: TMyRecord = (a: 100; b: 'foo');
	end;

var
	r: TMyRecord = TMyRecord.default;


Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list