将blob类型转换为文件

参数:a_blob,a_filename

 

功能:将指定的a_blob数据类型,转为指定文件

 

 

int l_filenum,l_loops,i
long l_filelength

l_filelength=Len(a_blob)
if l_filelength>32765 then
 l_loops = ((l_filelength - 1)/32765) + 1
else
 l_loops = 1
end if

l_filenum = FileOpen(a_filename,StreamMode!, Write!, LockWrite!,Replace!)

if l_filenum>0 then
 for i = 1 to l_loops
  FileWrite(l_filenum, blobmid(a_blob, (i - 1)*32765+1, 32765))
 next
 fileclose(l_filenum)
 return 0
else
 return -1
end if

你可能感兴趣的:(技术类)