comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Converting Byte Arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Converting Byte Arrays [message #10049] Mon, 06 October 1997 00:00 Go to previous message
popprice is currently offline  popprice
Messages: 3
Registered: September 1995
Junior Member
I am struggling with a file i/o problem. I have a data file which comes
from a PC. I know the data structure in terms of how many bytes correspond
to each entry in the file and what file type for each of these entries
(i.e. integer, real, etc). Generally, I two bytes into a variable for a
integer and 4 bytes for a real. I can convert the integers simply enough.
For a variable named id which is a bytarr(2) the integer is simply
256*id(1)+id(0). However, how can I convert the 4 byte arrays which are
floats into the proper numbers? I seem to come up with gibberish if I do a
simple float(val) where val=byytarr(4).

Any thoughts or tricks? All help much appreciated.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: compiling into function
Next Topic: Re: programming languages vote - results

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:42:19 PDT 2025

Total time taken to generate the page: 0.00458 seconds