home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / pascal / 5245 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.3 KB

  1. Path: sparky!uunet!zephyr.ens.tek.com!psgrain!qiclab!leonard
  2. From: leonard@qiclab.scn.rain.com (Leonard Erickson)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: xxx.ndx reading
  5. Message-ID: <1992Sep8.184536.11078@qiclab.scn.rain.com>
  6. Date: 8 Sep 92 18:45:36 GMT
  7. References: <1992Sep1.1009.8464@dosgate> <5ukJqB1w164w@bowker.com>
  8. Reply-To: 70465.203@compuserve.com
  9. Organization: SCN Research/Qic Laboratories of Tigard, Oregon.
  10. Lines: 33
  11.  
  12. jnicholson@bowker.com (Jim Nicholson) writes:
  13.  
  14. >Here's a fragment from that program.  I've not tested this yet . . .
  15.  
  16. >function MStoIEEE (MS : MSSingle) : real;
  17.  
  18. >{ Converts a 4 byte Microsoft format single precision real variable as    }
  19. >{ used in earlier versions of QuickBASIC and GW-BASIC to IEEE 6 byte real }
  20.  
  21. >var
  22. >    r      : real;
  23. >    ieee   : array[0..5] of byte absolute r;
  24.  
  25. >begin
  26. >    FillChar(r,sizeof(r),0);
  27. >    ieee[0] := MS[3];
  28. >    ieee[3] := MS[0];
  29. >    ieee[4] := MS[1];
  30. >    ieee[5] := MS[2];
  31. >    MStoIEEE  := r;
  32. >end;  { MStoIEEE }
  33.  
  34. One comment. The TP 6-byte "real" format is *not* IEEE! Otherwise the
  35. code looks ok. I had to do the opposite... read TP "reals" in Turbo
  36. BASIC. :-)
  37.  
  38.  
  39. >jnicholson@bowker.com
  40. -- 
  41. Leonard Erickson              leonard@qiclab.scn.rain.com
  42. CIS: [70465,203]             70465.203@compuserve.com
  43. FIDO:   1:105/51     Leonard.Erickson@f51.n105.z1.fidonet.org
  44. (The CIS & Fido addresses are preferred)
  45.