1.记录类型的定义
type
info = record
name :string;
age :integer;
addr :string;
end;
2.记录类型应用
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
procedure TForm1.Button1Click(Sender: TObject);
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
type
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
myinfo = record
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
name : string;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
age : Integer;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
addr : string;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
end;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
var
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
info : myinfo;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
begin
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
info.name:='longker';
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
info.age :=29;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
info.addr:='GuiLin';
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
end;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
procedure TForm1.Button2Click(Sender: TObject);
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
type
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
myinfo = record
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
name : string;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
age : Integer;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
addr : string;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
end;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
var
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
info : myinfo;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
begin
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
with info do
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
begin
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
name:='longker';
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
age :=29;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
addr:='GuiLin';
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
end;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
//Edit1.Text:=info.name;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
end;