Re: Hexadecimal and whatever...
- Posted by Jacques Deschenes <desja at QUEBECTEL.COM> Apr 15, 1997
- 909 views
At 16:57 97-04-15 -0400, you wrote: >---------------------- Information from the mail header ----------------------- >Sender: Euphoria Programming for MS-DOS <EUPHORIA at >MIAMIU.ACS.MUOHIO.EDU> >Poster: The Reaper <reaper at LOKI.ATCON.COM> >Subject: Hexadecimal and whatever... >------------------------------------------------------------------------------- > >Okay. I get this BRILLIANT idea and decide to star reading bytes from files. >I need to make it a number, so I use bytes_to_int to change a set of four bytes. >Truth is, I'm seeing if I can read data in from a MIDI file (don't ask me >why), and I read in the integer 101053452 (well, not exactly), but I'm >supposed to get the hexadecimal 00000006. Anyways, I think the problem is >that I need to read the bytes directly into hexadecimal. Anyone know how to >do that? > >P.S. Anyone know what I'm talking about? > 1) In MIDI file integer are stored in straigth order as opposed to the inverted order used in PC. bytes_to_int() suppose that the first byte is the least significant (INTEL style) in MIDI file the first byte is most significant (MOTOROLA style), so bytes_to_int() will give a wrong result if you use it to read MIDI file. Jacques Deschenes Baie-Comeau, Quebec Canada desja at quebectel.com