tinge...@worldaccess.nl wrote:
> Hello,
> I am using an application, written in TP, that uses data-files
> in some compressed-binary format. I don't have the sourcecode.
> The records in the data-files are 28 bytes long (7 x 4).
> At the moment I can write and read numbers in the files using the
> Qbasic-functions MKSMBF$ and CVSMBF as mentioned in the following >
> code.
> The records written to the file "test.dat" are fully compatible
> with the application. So, what's the problem?
> Well, for a longer time I have been looking for Pascal-functions that
> will do these routines, so I can integrate them in my own
> Pascal-program and don't need Qbasic anymore. I surely am not an
> expert on binary etc, so your help will be appreciated indeed.
> Thanks!
> Bert Tingen.
> CLS
> TYPE inform
> datum AS STRING * 4
> opn AS STRING * 4
> hoog AS STRING * 4
> laag AS STRING * 4
> slot AS STRING * 4
> omzet AS STRING * 4
> inter AS STRING * 4
> END TYPE
> DIM tbireco AS inform
> OPEN "test.dat" FOR RANDOM AS #1 LEN = 28
> renum% = LOF(1) / 28
> dat = 940103: frst = 215.25: high = 219.75: low = 214.5
> krs = 217.55: omz = 555666: intop = 0
> tbireco.datum = MKSMBF$(dat)
> tbireco.opn = MKSMBF$(frst)
> tbireco.hoog = MKSMBF$(high)
> tbireco.laag = MKSMBF$(low)
> tbireco.slot = MKSMBF$(krs)
> tbireco.omzet = MKSMBF$(omz)
> tbireco.inter = MKSMBF$(intop)
> PUT #1, renum% + 1, tbireco
> FOR i% = 1 TO renum% + 1
> GET #1, i%, tbireco
> PRINT CVSMBF(tbireco.datum);
> PRINT USING "######.##"; CVSMBF(tbireco.opn);
> PRINT USING "######.##"; CVSMBF(tbireco.hoog);
> PRINT USING "######.##"; CVSMBF(tbireco.laag);
> PRINT USING "######.##"; CVSMBF(tbireco.slot);
> PRINT USING "#########"; CVSMBF(tbireco.omzet);
> PRINT USING "####"; CVSMBF(tbireco.inter)
> NEXT i%
> CLOSE #1
> END