vb 中怎么将数据文件读入到数组中
1个回答
展开全部
如果需要读入不定个数,那就在程序中再加一句输入n的语句,或添加一text1,其中内容表示元素个数。
private
sub
form_click()
dim
a(1
to
10000)
as
integer,n
as
integer
n
=
inputbox("请输入数组元素个数",
"输入框")
'
n=val(text1.text)
open
"e:\vbprogram\input\0.txt"
for
input
as
#1
for
i
=
1
to
n
input
#1,
a(i)
next
close
#1
for
i
=
1
to
n
print
a(i)
next
end
sub
private
sub
form_click()
dim
a(1
to
10000)
as
integer,n
as
integer
n
=
inputbox("请输入数组元素个数",
"输入框")
'
n=val(text1.text)
open
"e:\vbprogram\input\0.txt"
for
input
as
#1
for
i
=
1
to
n
input
#1,
a(i)
next
close
#1
for
i
=
1
to
n
a(i)
next
end
sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询