急求vb程序编写!!在顺序文件words.dat 中有一批英文单词,将他们以a打头的单词输出

来源:百度知道 编辑:UC知道 时间:2024/06/22 08:22:57

sub form1_load
open "words.data" for input as #1
dim word as string
while eof(1)=0
input #1,word
if left(word,1)="a" then
print word
end if
wend
close #1
end sub

open words.data for input as #1
do while not eof(1)
line input #1,tempstr
if left(tempstr,1)="a" then
str=str+tempstr+vbcrlf
end if
loop
close #1
label1.caption=str