do语录
来源:励志语录 发布时间:2013-02-10 点击:
do语录篇一
Do...Loop语句
Do...Loop语句
使用循环语句可以重复执行一组语句,这组语句也称为循环体。循环语句分为三类:一类在条件为False 之前重复执行语句;一类在条件变为 True 之前重复执行语句;另一类按照指定的次数重复执行语句。
在VBScript中,可以使用下列循环语句。
Do...Loop语句,当(或直到)条件为True时执行循环体。
While...Wend语句,当条件为True时执行循环体。
For...Next语句,指定循环次数,使用计数器重复执行一组语句。
For Each...Next语句,对于集合中的每项或数组中的每个元素,重复执行一组语句。
1、Do While(Until)…Loop
Do While(Until)...Loop语句当条件为 True 时或条件变为 True 之前重复执行某语句块。根据循环条件出现的位置,Do...Loop语句的语法格式分为两种形式。
在第1种语法格式中,循环条件出现在语句首部,即
Do [{While | Until } <条件> ]
[ <语句列1> ]
[Exit Do]
[ <语句列2> ]
Loop
注解:
Do While...Loop是前测型循环语句,当条件为真(True)时执行循环体,条件为假时终止循环体,Do Until...Loop是当条件为假是执行循环体,直到条件为真时终止。 "条件"是条件表达式,为循环的条件。其值为True或False。
"语句列"是一条或多条命令(即循环体),它们将被重复执行,直到条件变为False或True。
"Exit Do"语句将控制权转移到紧接在Loop命令之后的语句。如果Exit Do使用在嵌套的Do...loop语句中,则Exit Do会将控制权转移到Exit Do所在位置的外层循环。可以在Do...Loop中的任何位置放置任意个Exit Do语句。
2、 简单实例1:
<html>
<head>
<title>Do While...Loop语句</title>
<script language="VBScript">
Sub btnShow_onClick()
Dim counter,sum
counter=1
sum=0
Do While counter<=100
sum=sum+counter{do语录}.
counter=counter+1
Loop
MsgBox "1+2+3+...+100=" & sum & "。",vbonlyOK+vbInformation,"Do While...Loop语句应用示例"
End Sub
</script>
</head>
<body>
<center>
想知道1+2+3+...+100相加起来是多少吗?<p>
<form>
<input type="button" name="btnShow" Value="请点击查看结果">
</form>
</center>
</body>
</html>
do语录篇二
do case 语句
6、表RSDA.DBF结构为:姓名(C,6);性别(C,2),年龄(N,2),出生日期(D,8)。判断表中是否有"李明",查询此人的性别及年龄,确定参加运动会的项目。
SET TALK OFF
USE RSDA
***********SPACE**********
【?】 FOR 姓名= "李明"
***********SPACE**********
IF .NOT. 【?】
DO CASE
CASE 性别= "男"
?"请参加爬山比赛"
CASE 年龄<=50
? "请参加投篮比赛"
CASE 年龄<=60
? "请参加老年迪斯科比赛"
***********SPACE**********
【?】
ELSE
? "查无此人"
BROWSE
ENDIF{do语录}.
USE
SET TALK ON
RETURN
『答 案』:
1 LOCATE 或 LOCA 或 LOCATE★ALL 2 EOF() 3 ENDCASE 或 ENDC
13、对表XSDB.DBF中的计算机和英语都大于等于90分以上的学生奖学金进行调整:法律系学生奖学金增加12元、英语系学生奖学金增加15元、中文系学生奖学金增加18元,其他系学生奖学金增加20元。请在【】处添上适当的内容,使程序完整。
USE XSDB{do语录}.
***********SPACE**********
【?】
DO WHILE FOUN()
DO CASE
CASE 系别="法律"
ZJ=12
CASE 系别="英语"
ZJ=15
CASE 系别="中文"
ZJ=18
***********SPACE**********
【?】
ZJ=20
ENDCASE
REPL 奖学金 WITH 奖学金+ZJ
***********SPACE**********
【?】
ENDDO
USE
『答 案』: 1 LOCA★FOR★计算机★>=90 ★.AND.★英语★>=90 或 LOCA★FOR★90<=★计算机★.AND.★90<=英语 或 LOCA★FOR★90<=★计算机★.AND.★英语★>=90 或 LOCA★FOR★计算机★>=90 ★.AND.★90<=★英语 或 LOCA★FOR★计算机★>=90 ★AND★英语★>=90 或 LOCA★FOR★90<=★计算机★AND★90<=英语 或 LOCA★FOR★90<=★计算机★AND★英语★>=90 或 LOCA★FOR★计算机★>=90 ★AND★90<=★英语
2 OTHERWISE 或 CASE★NOT★(★系别★=★"法律"★OR★系别★=★"英语"★OR★系别★=★"中文"★) 或 CASE★.T. 或 CASE★NOT★(★系别★=★'法律'★OR★系别★=★'英语'★OR★系别★=★'中文'★) 或 CASE★NOT★(★系别★=★[法律]★OR★系别★=★[英语]★OR★系别★=★[中文]★)
18、实现:求0-100之间的奇数之和,超出范围则退出。
X=0
Y=0
DO WHILE .T.
X=X+1
DO CASE
***********SPACE**********
CASE 【?】
LOOP
CASE X>=100
***********SPACE**********
【?】
OTHERWISE
Y=Y+X
ENDCASE
***********SPACE**********
【?】
? "0-100之间的奇数之和为: ", Y
RETURN
『答 案』:
1 MOD(★X,2)★=0 或 INT★(X/2)★=X/2 或 X%2★=0 或 0=MOD★(X,2) 或 X/2★=★INT(X/2) 或 0=★X%2 或 MOD(★X,2)★<>1 或 MOD(★X,2)★#1 或 MOD(★X,2)★!=1
2 EXIT 或 QUIT
3 ENDDO 或 ENDD
4、在RSH.dbf 中,查找职工赵红的工资,如果工资小于200元,则增加100元;如果工资大于等于200元且小于500元时,则增加50元;否则增加20元。最后显示赵红的姓名和工资。
CLEAR
USE RSH
LOCATE FOR 姓名 =赵红
DO CASE
CASE 工资< 200
REPLACE 工资 WITH 工资+ 100
CASE 工资< 500
REPLACE 工资 WITH 工资+ 50
OTHERWISE
REPLACE 工资 WITH 工资+ 20
ENDCASE
***********FOUND**********
LIST 姓名,工资
USE
『答 案』:1 LOCATE FOR 姓名= "赵红" 或 LOCA FOR 姓名= '赵红' 或 LOCA FOR 姓名= "赵红" 或 LOCATE FOR 姓名= [赵红] 或 LOCA FOR 姓名= [赵红] 或 LOCATE FOR 姓名= '赵红' 2 DISP 姓名,工资 或 ?姓名,工资 或 DISPLAY 姓名,工资
10、统计RSH.dbf 中职称是教授、副教授、讲师和助教的人数。
USE RSH
***********FOUND**********
STORE 1 TO A , B , C , D
DO WHILE .NOT.EOF ( )
DO CASE
CASE 职称 = "教授"
A = A + 1
CASE 职称 = "副教授"
B = B + 1
CASE 职称 = "讲师"
C = C + 1
CASE 职称 = "助教"
D = D + 1
ENDCASE
***********FOUND**********
NEXT 1
ENDDO
USE
? A,B,C,D
『答 案』:1 STORE 0 TO A,B,C,D 2 SKIP 或 SKIP 1
36、键盘输入X值时,求其相应的Y值
* ┌ -1 (X<0)
* │
* Y=├ 0 (X=0)
* │
* └ 1 (X>0)
SET TALK OFF
ACCEPT "请输入一个数:" TO X **********FOUND********** DO WHILE
CASE X<0
Y=-1
CASE X=0
Y=0
**********FOUND********** DEFAULT X>0 Y=1
ENDCASE
? Y
SET TALK OFF
『答 案』:
1 INPUT
2 DO CASE
3 OTHERWISE 或 case x>0
do语录篇三
乔布斯十三句发人深省的经典名言
乔布斯十三句发人深省的经典名言
With a life as storied as he had, it's no wonder that Steve Jobs is remembered not only for running an incredibly successful company, but for being tremendously outspoken.
He seemingly had an opinion on everything, and his thoughts often echoed his obsessive commitment to quality at Apple, whether on his approach to mistakes ("Sometimes when you innovate, you make mistakes. It is best to admit them quickly, and get on with improving your other innovations"), or his attention to detail ("Design is not what it looks and feels like. Design is how it works"). But he had plenty to say on deeper matters as well. Here's a roundup of some of his more thought-provoking words, collected from various interviews and speeches.
有关创造力
"Creativity is just connecting things. When you ask creative people how they did something, they feel a little guilty because they didn't really do it, they just saw something. It seemed obvious to them after a while."
―创造力就是找到事物之间的联系。当你询问有创意的人他们是如何做事时,他们觉得有点内疚,因为他们并没有真的这么做,他们只是看到了其中一些关系。这种感觉在他们过后看来会很明显。
有关死亡
"Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose. You are already naked. There is no reason not to follow your heart."
记住,每个人终将会死去,这是我认为能够避免个人患得患失的最好方式,你已经赤裸裸地面对死亡,那就没有什么理由不去追随自己的心。‖
有关卓越
"Be a yardstick of quality. Some people aren't used to an environment where excellence is expected."
―要做一个质量标杆,有些人还不习惯面对一个卓越的环境。‖
有关未来
"You can‘t connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something – your gut, destiny, life, karma, whatever. This approach has never let me down, and it has made all the difference in my life."
―你无法在展望未来时串联点滴,你只能在回顾过去时将其升华。所以你要相信,这些点滴片段会在未来以某种方式串联起来。你要相信某种东西——直觉也好,命运也好,生命也好,或者因缘甚至是其他一切。这种方法从来没有让我失望,在我的生活中,这种意念造就了我的与众不同。‖
有关坚持
"Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven‘t found it yet, keep looking. Don‘t settle. As with all matters of the heart, you‘ll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don‘t settle."
―你的工作将占据你生活中的很大一部分,能够让你真正满意的唯一方法就是做你相信是伟大的工作,而唯一伟大的工作就是爱你所做的事。如果你还没有找到它,那么继续找,不要停。用心去找,你会知道何时能够找到它。如同任何伟大的关系一样,它只会在时间的证明之下越来越好,所以继续找,不要停,直到你找到它。‖{do语录}.
有关追求
"Being the richest man in the cemetery doesn‘t matter to me … Going to bed at night saying we‘ve done something wonderful … that‘s what matters to me." ―成为墓地里最有钱的人并不是我最在意的事....。.真正对我有意义的事,就是在晚上睡觉前说上一句‗我已经做了一些非常棒的事‘....。.这才是我最在乎的。‖
有关创新
"I‘m as proud of many of the things we haven‘t done as the things we have done. Innovation is saying no to a thousand things."
―我引以为豪是,许多我们所做的事情变成我们还没有完成的事,创新就是对一千件事情说‗不‘。‖
有关目标
―I think if you do something and it turns out pretty good, then you should go do something else wonderful, not dwell on it for too long. Just figure out what‘s next.‖
―我想如果你做了某些事,结果顺利圆满,那么你应该选择转去做别的事情,别专注在美好的事情上太久,只要保持寻找下一个目标。‖
有关失意
"Getting fired from Apple was the best thing that could have ever happened to me. The heaviness of being successful was replaced by the lightness of being a beginner again. It freed me to enter one of the most creative periods of my life." ―从苹果公司离职曾是我人生中最好的一件事,追求成功的沉重被创业者的轻松感觉所取代,这让我感觉如此自由,我重新进入一个人生中最有创造力的阶段。‖
有关质量
"Quality is more important than quantity. One home run is much better than two doubles."
―质量比数量更重要,就像一个本垒打胜过两个双打。‖
有关改变
"When I was 17, I read a quote that went something like: 'If you live each day as if it was your last, someday you'll most certainly be right.' It made an
impression on me, and since then, for the past 33 years, I have looked in the mirror every morning and asked myself: 'If today were the last day of my life,
would I want to do what I am about to do today?' And whenever the answer has been 'no' for too many days in a row, I know I need to change something." ―我曾在 17 岁时读过这么一句名言:‗如果你把每一天当成自己人生的最后一天来过,那么将来某一天你会明白其中的真意‘,这句话令我印象深刻,此后的 33 年来,我每天早上都会对着镜子自问:‗如果今天是我生命的最后一天,我还会想去做我今天要去做的事吗?‘,每当我心里的答案是‗不‘时,我知道自己需要做出改变了。‖
有关毅力
"I'm convinced that about half of what separates successful entrepreneurs from the non-successful ones is pure perseverance."
―我相信一半成功的企业家和另一半不成功的企业家的区别在于纯粹的毅力。‖
有关自省
"I want to put a ding in the universe."{do语录}.
―我希望可以在宇宙中安装一口警钟。‖
do语录篇四
《碟中谍5》经典语录台词
《碟中谍5》经典语录台词
《碟中谍5》电影简介:
电影《碟中谍5》全名是《碟中谍:神秘国度》,是《碟中谍》系列电影中的第五部,有汤姆·克鲁斯、杰瑞米·雷纳等演员,更有张静初加盟。影片讲述了由汤姆·克鲁斯饰演的伊桑·亨特及其团队成员遭到了“神秘国度”组织追杀的惊险刺激故事,看看伊桑如何完成这项不可能的任务,张静初又会有怎样的表现吧。
《碟中谍5》经典语录台词
这是不可能的任务。
——《碟中谍5》经典语录
这是我们最后的任务。
——《碟中谍5》经典语录
回护她不是你的事情,而是我的。
——《碟中谍5》经典语录
你用硬盘做饵来诱捕莱恩。
——《碟中谍5》经典语录
Youhaveawarmhand.你的手好暖。
——《碟中谍5》经典语录
-咱们去克里姆林宫。
-你说克里姆林宫?你说克里姆林宫!?
——《碟中谍5》经典语录
他的运气总会用完。
——《碟中谍5》经典语录
我很负疚,我想说,对于茱莉亚我也是喜欢她的?
——《碟中谍5》经典语录
但是你心里多少明白这次是棋逢敌手。
——《碟中谍5》经典语录
Wecanbeanyone,wecandoanything.It‘sonlyamatterofgoing!
——《碟中谍5》经典语录
-为何我叫冥王星?他都没有算小行星了!
-你叫天河系啊?
——《碟中谍5》经典语录
跟我一起走吧。
——《碟中谍5》经典语录
Killingkeepsthingsastheywere„humannatureismychoiceofweapon. ——《碟中谍5》经典语录
你始终很美,可是我之前始终没对于你说。
——《碟中谍5》经典语录
非常时期就要用非常手段。
——《碟中谍5》经典语录