[fpc-pascal]Real bpw and fpc
Arne Hanssen
arne-h at c2i.net
Tue Oct 2 17:46:52 CEST 2001
Thus spoke adeli at adeli.fr (Ldrevon at adeli.fr):
> Hi all
> Does anybody know how to convert a real type from bpw to fpc and vice-
> versa:
> i explain : bpw real have 6 byte long and fpc 8 !
> I have to translate somes struct binary files from bpw to fpc!
I don't know how to do this in FPC, but using BP (or VP) you can
read data files using REAL an write them using the DOUBLE data type.
Example:
----------------------------------------------------------
type
oldrec = record
:
data: real;
:
end;
newrec = record
:
data: double;
:
enc;
var
olddata: oldrec;
newdata: newrec;
begin
:
read( oldfile, olddata );
newdata.data := olddata.data; // convert real to double
write( newfil, newdata );
:
end.
----------------------------------------------------------
--
Vennlig hilsen / Best regards |\ ___,,--, _
Arne Hanssen, Senja, Norway /,`--'' \-,,__,'/
http://home.c2i.net/nite/arne |,4 ) )_ ) /~-----'
http://home.c2i.net/bkgras -----'---^~(_/-_)--(_/_)-------
More information about the fpc-pascal
mailing list