乡团委书记的级别:delphi中如何生成agt文件

来源:百度文库 编辑:高校问答 时间:2024/04/30 02:42:02
1.agt是这种格式的文件是用来存储什么的?
2.用Delphi如何来生成这种文件?

回答:zhanghay1
新手
5月8日 15:28 因为这里使用了with语句。

With语句是一种用于简化代码的语句。如你要访问一个记录类型变量(或一个对象),用With语句就不必每次重复变量的名字。例如对于以下的记录类型代码:

type
Date = record
Year: Integer;
Month: Byte;
Day: Byte;
end;

var
BirthDay: Date;

begin
BirthDay.Year := 1997;
BirthDay.Month := 2;
BirthDay.Day := 14;

可以用with语句改进后半部分代码,如下:

begin
with BirthDay do
begin
Year := 1995;
Month := 2;
Day := 14;
end;

在Delphi程序中,这种方法能用于访问控件和类变量。