private sub command1_click()
dim i as integer
randomize
for i=0 to 9
a(i)=int(rnd*101)
text1.text=text1.text & a(i) & ","
next i
end sub
private sub command2_click()
dim b as integer,i as integer,c as boolean
b=val(inputbox("請輸入壹個數字"))
c=false
for i=0 to 9
if b=a(i) then
c=true
exit for
end if
next
if c=false then text2.text="不存在於數組中" else text2.text="在數組中的位置=" & i+1
end sub