Board index » delphi » How convert REAL type stored in six bytes to number

How convert REAL type stored in six bytes to number

How to convert REAL type stored in six bytes (example:  143; 0; 0; 0; 152;
105) to number representation.
I've an old data base in which real type is stored in six byte position and
I don't know how to convert these to a number.

Tomi

 

Re:How convert REAL type stored in six bytes to number


Quote
"Tomek" <xx20...@wp.pl> wrote in message news:aeval4$so2$1@news.tpi.pl...
> How to convert REAL type stored in six bytes (example:  143; 0; 0; 0; 152;
> 105) to number representation.
> I've an old data base in which real type is stored in six byte position
and
> I don't know how to convert these to a number.

> Tomi

TP up to and including TP7 understands the Real type. In particular, the
freely-downloadable TP5.5 understands it, as well as float and double. So if
your database uses records, you could do a conversion program:

type
  tOldRecord = Record
    ...
    SomeNumber:Real;
    ...
  end;

  tNewRecord = Record
    ...
    SomeNumber:Double;
    ...
  end;

var
  NewRecord: tNewRecord;
  OldRecord: tOldRecord;

...
  NewRecord.SomeNumber = OldRecord.SomeNumber;
...

Because the compiler supports both types, this does the correct conversion.

TP5.5 is available from the Borland website, in the Museum section. Its
online help should also describe the format of 6-byte reals.

FP

Re:How convert REAL type stored in six bytes to number


JRS:  In article <aevakh$sj...@news.tpi.pl>, seen in
news:comp.lang.pascal.ansi-iso, Tomek <xx20...@wp.pl> posted at Fri, 21
Jun 2002 15:38:49 :-

Quote
>How to convert REAL type stored in six bytes (example:  143; 0; 0; 0; 152;
>105) to number representation.
>I've an old data base in which real type is stored in six byte position and
>I don't know how to convert these to a number.

This is the ANSI-ISO group, in which such formats are not known.

If the format is the Turbo Pascal 6-byte format, see
<URL:http://www.merlyn.demon.co.uk/pas-type.htm#Conv> ff.

---

DO NOT MULTI-POST.

--
? John Stockton, Surrey, UK.  j...@merlyn.demon.co.uk   Turnpike v4.00   MIME. ?
  <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
  <URL:http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ;
  <URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.

Other Threads