请教个函数的含义
不会PB,只知道文件是PB的这个函数生成的,麻烦大家解释下这个函数是如何生成文件的
我想用delphi读取该函数生成的文件可行么
public function long of_writefile (string as_filename, ref blob abl_data);
/*
returns : integer (-1=error, > =0 number of bytes written)
arg1 : string as_FileName (Filename of the file to write)
arg2 : ref blob abl_data (source data)
This function writes the contents of the abl_data blob to disk
with the specified filename.
Revision record
Date Author Modification
*/
SetPointer(HourGlass!)
long ll_file
long ll_written
long ll_tot
long ll_writ
/* Open or create the file in replace mode */
ll_file = fileopen(as_filename,streammode!,write!,lockwrite!,replace!)
if ll_File <= 0 then
messagebox( 'Error writing file ',as_filename)
return -1
end if
/* write the contents to that file */
ll_tot = len(abl_data)
do while true
ll_writ = filewrite(ll_file,blobmid(abl_data,ll_written+1) )
if ll_writ = 0 then exit
ll_written += ll_writ
if ll_Written > = ll_tot then exit
loop
fileclose(ll_file)
return ll_written
end function