VB定义动态数组大小和FOR循环
optionbase1privatesubform_click()dimxl()asintegerdimiasintegerdimsasintegerredimxl(3)...
option base 1
private sub form_click()
dim xl() as integer
dim i as integer
dim s as integer
redim xl(3)
for i=1 to ubound(xl)
xl(i)=i+1
next i
call sub1(xl)
for i=1 to ubound(xl)
x=s+xl(i)
next i
print s
end sub
private sub sub1(n() as integer)
dim i as integer
redim preserve n(5)
for i=3 to 5
n(i)=n(i-1)*2
next i
end sub
显示()
A,6
B,12
C,24
D,47
解释一下 展开
private sub form_click()
dim xl() as integer
dim i as integer
dim s as integer
redim xl(3)
for i=1 to ubound(xl)
xl(i)=i+1
next i
call sub1(xl)
for i=1 to ubound(xl)
x=s+xl(i)
next i
print s
end sub
private sub sub1(n() as integer)
dim i as integer
redim preserve n(5)
for i=3 to 5
n(i)=n(i-1)*2
next i
end sub
显示()
A,6
B,12
C,24
D,47
解释一下 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询