All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
sql server2005设置自动备份全过程_[SQL Server教程]
php+mysq 修改用户密码(用password加密)_[PHP教程]
通过PHP和Sajax使用Ajax之javascript_php资料_编程技术
JavaScript变换图片的几种方法_JavaScript技术_编程技术
随机显示数据库记录_[Asp.Net教程]
C#教程:C#2.0 新特性 匿名方法
如何让apache支持url_rewrite_php资料_编程技术
区别和认识.Net四个判等函数_.net资料_编程技术
c#中GDI+图形图像:GDI+中的贝塞尔样条使用方法
ASP.NET技巧:repeater实现多列显示_.net资料_编程技术
Reading number is top 10 pictures
BingBingFan apple dew point photo gallery2
This is heaven to some path
A man's favorite things6
In 2013 hercules Arnold classic1
六种更聪明的工作方法
2012 national geographic daily picture8
Shandong jinan is about to dismantle a one hundred-year history of the building
什么叫国家
水晶头骨造型的酒瓶
Sell the barbecue as says father du breul4
Download software ranking
Jinling thirteen stock
The king of fighters 97(Mobile phone games-apk)
c#程序设计案例教程
DreamWeaver8
Boxer's Top ten classic battle7
Kung.Fu.Panda.2
Tram sex maniac 2 (H) rar bag12
Sora aoi - one of more PK
Tram sex maniac 2 (H) rar bag3
I for your crazy
aaa published in(发表于) 2014/7/19 0:14:14 Edit(编辑)
[delphi语法5]delphi中Case语句的使用方法

[delphi语法5]delphi中Case语句的使用方法

[delphi语法5]delphi中Case语句的使用方法|技巧

Case 语句

If...Then?Else 语句适合选项较少的情况,如果有很多选项的话利用If 语句就比较麻烦,在这种情况下,Case 语句就容易多了。Case 语句的语法如下:

case <表达式> of

<数值>:<语句>;

<数值>:<语句>;

else

<语句>;

end;

下面这个例子中的S 为Char 类型。当用户输入一个字符后按回车键确认后判断变量S,如果是小写或大写字母将显示“字符”,如果是数字,则显示“数字”,其余的字符就显示“其他”,判断语句如下:

var

S:Char;

begin

Readln(S);

case S of

’a’..’z’, ’A’..’Z’:Writeln(’字符’);

’0’..’9’:Writeln(’数字’);

else

Writeln(’其他’);

end;

注意:Case 构造中的任何一个语句都可以是单语句或复合语句。如果需要在某种情况下执行多行代码,必须将它们用Begin?End 括起来。




添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.