Go homepage(回首页)
Upload pictures (上传图片)
Write articles (发文字帖)

The author:(作者)aaa
published in(发表于) 2014/7/19 0:14:21
[delphi语法9]delphi中with语句的使用实例

[delphi语法9]delphi中with语句的使用实例|方法

with语句

使用记录类型的变量时,可以通过With 语句指定一些语句,这些都是针对某一个变量来说的,这样可以简化代码的输入量。With 语句的形式如下:

with object do statement

例如:

type

TEmployee=record

Name : string[20];

YearHired:2000..2010;

Salary: Double;

Position: string[20];

end;

var

Employee:TEmployee;

begin

with Employee do

begin

Name :=’Wang’;

YearHired :=2005;

Salary :=10000;

Position := ’ Technic Department’;

end;




If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)





QQ:154298438
QQ:417480759