首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > PB >

PB 读大文件的有关问题

2013-01-02 
PB 读大文件的问题!请教个问题。PB有没有类似于ReadHuge()这种一次性读大文本文件的函数。一次处理读入300多

PB 读大文件的问题!
请教个问题。PB有没有类似于ReadHuge()这种一次性读大文本文件的函数。一次处理读入300多M文件太慢了。。或者有没有类似的API。
==========================================
现在处理了一下
blob ls_filecontext,ls_tmp
String str
int i,loops,j
//debugbreak()
k=1
ll_FLength = filelength(named)
ll_FileNum = FileOpen(named,StreamMode!, Read!, LockRead!)
if ll_FLength > 32765 then 
if mod(ll_FLength,32765) = 0 then 
   loops= ll_FLength/32765 
else
   loops= ll_FLength/32765 +1
end if 
else
loops=1
end if 
// read file
//SetPointer(hourglass!)
for i=1 to loops 
j=FileRead(ll_filenum,ls_tmp)

//ls_filecontext=ls_filecontext+ls_tmp//这句不加的话368M文本8秒读进来。

k++
sle_hang.text=string(k)
next
FileClose(ll_FileNum)
//str=String(ls_filecontext)

但是读进来的数据合并时非常耗时间,谁有好办法?
[解决办法]
用VC写的dll

热点排行