VB中“For Each 区域1 In

散文鱼2022-10-04 11:39:541条回答

已提交,审核后显示!提交回复

共1条回复
阿蛮二 共回答了16个问题 | 采纳率87.5%
For Each...Next 语句
针对一个数组或集合中的每个元素,重复执行一组语句.
语法
For Each element In group
[statements]
[Exit For]
[statements]
Next [element]
For...Each...Next 语句的语法具有以下几个部分:
部分 描述
element 必要参数.用来遍历集合或数组中所有元素的变量.对于集合来说,element 可能是一个 Variant 变量、一个通用对象变量或任何特殊对象变量.对于数组而言,element只能是一个 Variant 变量.
group 必要参数.对象集合或数组的名称(用户定义类型的数组除外).
statements 可选参数,针对 group 中的每一项执行的一条或多条语句.
说明
如果集合中至少有一个元素,就会进入 For...Each 块执行.一旦进入循环,便先针对 group 中第一个元素执行循环中的所有语句.如果 group 中还有其它的元素,则会针对它们执行循环中的语句,当 group 中的所有元素都执行完了,便会退出循环,然后从 Next 语句之后的语句继续执行.
在循环中可以在任何位置放置任意个 Exit For 语句,随时退出循环.Exit For经常在条件判断之后使用,例如If匮hen,并将控制权转移到紧接在 Next 之后的语句.
可以将一个 For...Each...Next 循环放在另一个之中来组成嵌套式 For...Each...Next 循环.但是每个循环的 element 必须是唯一的.
注意 如果省略 Next 语句中的 element,就像 element 存在时一样执行.如果 Next 语句在它相对应的 For 语句之前出现,则会产生错误.
不能在 For...Each...Next 语句中使用用户自定义类型数组,因为 Variant 不能包含用户自定义类型.
1年前

相关推荐

vb中 for each in语句求解释
vb中 for each in语句求解释
js=0
for each v in a
js = js+1
print v;
if js mod 6=0 then print
next v
end sub
求高手帮解释下这段语句.学VB没多久,希望能详细点.
mingchen01011年前1
Amanda-hoo 共回答了22个问题 | 采纳率90.9%
js=0
for each v in a ‘这个是统计a中v的个数,for each v in a 就是对a中的每一个对象v的动作
js = js+1
print v; ’这个是输出v的值,每六个v换一行
if js mod 6=0 then print ‘
next v
end su
For each word,write if the stress falls on the first syllabl
For each word,write if the stress falls on the first syllable or the second syllable 如何翻译
lf10201年前2
北溟烤鱼 共回答了7个问题 | 采纳率85.7%
对于每个单词来说,标出重音落在第一个音节或者是第二个音节的单词.
III. Reading Comprehension:31% Section ADirections: For each

III. Reading Comprehension:31%
Section A
Directions: For each blank in the following passage there are four words or phrases marked A, B, C and D. Fill in each blank with the word or phrase that fits the context.
Good news! Tiny robots designed by University of Nebraska researchers may 50 doctors on Earth to help perform surgery on patients in space.
The tiny, wheeled robots, which are about 3 inches tall and as wide a lipstick case, can be slipped into small incisions ( 切口 ) and computer-controlled by surgeons in different51 . Some robots are equipped with 52 and lights and can send images back to surgeons and others have surgical tools attached that can be controlled 53 .
“ We think this is going to 54 open surgery.” Dr. Dmitry Oleynikov said at a news conference. Oleynikov is a 55 in computer-assisted surgery at the University of Nebraska Medical Center in Omaha.
Officials hope that NASA will teach 56 to use the robots soon enough 57
surgeries could one day be performed in space.
The camera-carrying robots can provide 58 of affected areas and the ones with surgical tools will be able to operate inside the body in ways surgeons’ hands can’t. The views from the camera-carrying robots are 59 than the naked eye, because they 60 back color images that are magnified. Because several robots can be inserted through one incision, they could reduce the amount and 61 of cuts needed for surgery, which would decrease recovery time. This is particularly 62 to those patients who have been weakened by long illness.
Eventually, Oleynikov said, “ The tiny robots may enable surgeons to work without ever __63__their hands in patients’ bodies. That is the 64 . It is getting easier and easier. We can do even more with these devices.”
50. A. use B. pay C. allow D. force
51. A. locations B. directions C. fields D. ways
52. A. operators B. monitors C. cameras D. flashes
53. A. automatically B. remotely C. manually D. widely
54. A. perform B. undergo C. follow D. replace
55. A. reporter B. specialist C. designer D. director
56. A. astronauts B. nurse C. teachers D. trainers
57. A. in order to B. so that C. thus D. in case
58. A. answers B. services C. views D. insights
59. A. weaker B. stronger C. poorer D. better
60. A. send B. produce C. change D. create
61. A. measure B. size C. power D. pressure
62. A. relevant B. true C. helpful D. interesting
63. A. touching B. pressing C. holding D. placing
64. A. ambition B. goal C. achievement D. victory
yy骑巫妖小强1年前1
hlyong2000 共回答了16个问题 | 采纳率75%
50-54 CACBD 55-59 BABCD 60-64 ABCDB

POJ ..> RT,求括号括起来那句的意思.> > For each test case,print one line
POJ ..
> RT,求括号括起来那句的意思.
>
> For each test case,print one line of the form n = a + b,where a and b are odd primes.Numbers and operators should be separated by exactly one blank like in the sample output below.If there is more than one pair of odd primes adding up to n,【choose the pair where the difference b - a is maximized】.If there is no such pair,print a line saying "Goldbach's conjecture is wrong."
>
>
>
ydmei1年前1
come666111 共回答了21个问题 | 采纳率95.2%
就是说如果有多个(a,b)数对满足n=a+b的话,那么选择差b-a最大的那一对.
就比如n=16时,可以是(3,13)或者(5,11)
那么选择输出(3,13)这一组,因为13-3=10,11-5=6,而10>6.
英语翻译for each reduction of 0.01% below the specified carbon m
英语翻译
for each reduction of 0.01% below the specified carbon maximum .an increase of 0.06%mamganese above the specified will be permitted up to maximum of 1.35%
linxblinxb1年前1
watermelon2 共回答了17个问题 | 采纳率94.1%
每次减少的额度可以允许低于最大指定碳含量的0.01%
每次增加的额度可以允许高于最大指定碳含量的0.06%——1.35%
英语翻译For each BIM Use selected,identify the team within the o
英语翻译
For each BIM Use selected,identify the team within the organization (or organizations) who will staff and perform that Use
峰线缺人1年前3
leew 共回答了17个问题 | 采纳率100%
我们提供给你一个翻译,你还需要通过上下文再来理解体会.
我们暂且把BIM Use理解为BIM使用或服务,你得再看具体语境.大概意思为:对于每一个选择了的BIM使用或服务,我们要在一个或一些机构组织中进行核实鉴别,当然这些机构组织都是这项服务的领头者或实施者(who引导的定语从句修饰organization).