The author needs to process the DBF file data when developing an application system. In Pb, only the data formats of dbaseii and dbaseiii are supported, and the updated version is not supported. Therefore, you need to program your own processing. During programming, you may encounter read/write operations on binary files. For example, read files in the following format by byte and convert them to decimal characters.
AA 00 56 00 bb cc dd ee ff ......
CodeThis is probably the case:
Integer li_filenum, loops, I, K, L
Long FLEN, bytes_read, new_pos
Blob B, tot_ B, B1
Setpointer (hourglass !)
FLEN = filelength ("C:/file1.dat ")
Li_filenum = fileopen ("C:/file1.dat ",&
Streammode !, Read !, Lockread !)
If FLEN> 32765 then
If Mod (FLEN, 32765) = 0 then
Loops = FLEN/32765
Else
Loops = (FLEN/32765) + 1
End if
Else
Loops = 1
End if
New_pos = 1
For I = 1 to Loops
Bytes_read = fileread (li_filenum, B)
Tot_ B = tot_ B + B
Next
Fileclose (li_filenum)
L = Len (tot_ B)
For I = 1 to L
B1 = blobmid (tot_ B, I, 1)
K = ASC (string (B1 ))
Sle_1.text + = string (k) + ":"
Next
Display: 170: 0: 86: 0: 187: 187: 204: 221: 238: 255: