Record data types in Delphi represent a mixed set of elements. Each element is called a field; the declaration of a record type specifies a name and type for each field.
Constant Record
To create a constant or "read-only" record, use the next "initialization"://record declarationNote that if you try to assign a different value to any of the fields of the constant "DelphiDeveloper", you will get a compile time exception:
type
TDeveloper = record
Language : string;
Experience : integer;
Salary : Currency;
end;
...
//"DelphiDeveloper" TDeveloper constant
const
DelphiDeveloper : TDeveloper =
(
Language : 'Delphi';
Experience : 15;
Salary : 200000
) ;
begin
//compile time exception:
"Left side cannot be assigned to"
DelphiDeveloper.Language := 'C#'
end;
Delphi tips navigator:
» How to Override Delphi Form's Restore Operation?
« How to Store a String value to a Tag Property of a Delphi control

