All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

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

Writer: aaa Article type: Programming skills(编程技巧) Time: 2014/7/19 0:14:21 Browse times: 434 Comment times: 0

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


Head photo

Go homepage
Upload pictures
Write articles

[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;





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.