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

Reading number is top 10 articles
C#教程:MouseDown和MouseUp事件
ASP.NET,2.0打造购物车和支付系统之一_.net资料_编程技术
PHP技巧:PHP中几种删除目录的三种方法_[PHP教程]
PHP技巧:PHP中密码加密函数_[PHP教程]
asp.net,2.0下用access开发的时候要注意的问题_[Asp.Net教程]
详解aspx页面事件的执行顺序_[Asp.Net教程]
在ASP.NET中运用JavaScript_[Asp.Net教程]
PHP的十个高级技巧(下)_[PHP教程]
利用C#实现分布式数据库查询_[Asp.Net教程]
SQL Server 2000中的触发器使用分析_[SQL Server教程]
Reading number is top 10 pictures
Household design classic black and white
Female model behind the bitterness, often being overcharged5
Small QiShu -- ShuangShuangPan2
A beautiful girl to bud1
Look for from human art net, is good--3
Desktop Wallpapers1
人美胸美腿更美4
接财神,大吉大利,财源滚滚来
The beginning and end
Chinese paper-cut grilles art appreciation2
Download software ranking
Tram sex maniac 2 (H) rar bag3
豪门浪荡史
asp.netWeb服务器高级编程
SQL2000 For 4IN1
Boxer Classic video2
Sora aoi's film--cangkong_Blue.Sky
Tram sex maniac 2 (H) rar bag7
Call Of Duty5
好色的外科大夫
Jinling thirteen stock
aaa published in(发表于) 2014/7/19 0:14:09 Edit(编辑)
[delphi语法4]delphi中if语句的使用实例

[delphi语法4]delphi中if语句的使用实例

[delphi语法4]delphi中if语句的使用实例|方法

If 语句

If 语句的结构如下:

if <条件> then

<语句>;

还可以为基本语句添加Else 子句:

if <条件> then

<语句>

else

<语句>;

需要注意的是,上面两个例子中的<语句>可以是单语句或复合语句。If...Then 语句被认为是单语句,在语句结束时只有一个分号(在第1 种情况的Then 引导的子句之后,或在第2 种情况的Else 引导的子句之后)。

例如下面的代码中Date 为整数类型,判断Date 如果在1 与10 之间显示为“上旬”、11 与20 之

间显示为“中旬”、21 与31 之间显示为“下旬”,如果数值不包含在上述范围内则显示“错误的日期”:

if (Date>=1) and (Date<=10) then

Writeln(’上旬’)

else if (Date>=11) and (Date<=20) then

Writeln(’中旬’)

else if (date>=21) and (Date<=31) then

Writeln(’下旬’)

else

Writeln(’错误的日期’);

注意:Else 子句之前,Then 引导的子句之后是不能有分号的。




添加到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.