VB中的EOF和LOF函数怎么用?

2025-04-09 21:09:26
推荐回答(1个)
回答1:

eof() 函数的作用是判断是否到文件尾.例如:
dim s as string
open "c:\1.txt" for input as #1
do while not eof(1)
line input #1,s
print s
loop
close #1

lof 是返回的是打开的文件的大小,例如:
open "c:\1.txt" for input as #1
print lof(1)
close #1