record_field_init |
Smart pascal source code
type TRec = record Field: Integer = 1; Name := 'hello'; procedure WriteLnMe; begin WriteLn(Field); WriteLn(Name); end; end; var r: TRec; r.WriteLnMe; r.Field := 2; r.Name := 'world'; r.WriteLnMe; const cr1: TRec = (Field: 123); const cr2: TRec = (Name: 'World'); cr1.WriteLnMe; cr2.WriteLnMe; {<<< RESULT - CONSOLE LOG >>> ----------------------------- 1 hello 2 world 123 hello 1 World ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}