问题
单项选择题
设有命令按钮 Command1 的单击事件过程,代码如下:Private Sub Command1_Click() Dim a(30) As IntegerFor i=1 To 30a(i)=Int(Rnd*100) NextFor Each arrItem In aIf arrItem Mod 7=0 Then Print arrItemIf arrItem>90 Then Exit ForNextEnd Sub 对于该事件过程,以下叙述中错误的是______。
A.a数组中的数据是30个100以内的整数
B.语句For Each arrItem In a有语法错误
C.If arrItem Mod 7=0……语句的功能是输出数组中能够被7整除的数
D.If arrItem>90……语句的作用是当数组元素的值大于90时退出For循环
答案
参考答案:B
解析:For Each 语句的基本语法结构为:For Each 变量 In 数组 语句块Next [变量]本题中 For Each 语句没有语法错误。