• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bytes into integer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bytes into integer


  • Subject: Re: Bytes into integer
  • From: Emmanuel <email@hidden>
  • Date: Fri, 13 Feb 2004 15:36:12 +0100

At 8:31 AM -0500 2/13/04, Steve Roy wrote:
>I'm trying to extract a value out of a binary file with AppleScript. I have to
>read three bytes and turn them into an integer.

If indeed your integers are coded on 3 bytes, then I discard my post.

However if you're working with a standard binary file, where numbers are stored as an even number of bytes, then you may be underestimating AppleScript's "read" command: you can "read as small integer" (2-bytes integer), "read as integer" (4-bytes integer), "read as double integer" (8-bytes integer), "read as small real" (4-bytes real) and "read as real" (8-bytes real).

Finally, in case you don't know, the Satimage osax proposes a "read binary" command, which is rather versatile and may help you.

The Satimage osax is one of the scientific resources that Satimage-software makes freely available to the AppleScript community at <http://www.satimage-software.com>.

Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Bytes into integer
      • From: Steve Roy <email@hidden>
References: 
 >Bytes into integer (From: Steve Roy <email@hidden>)

  • Prev by Date: Re: do shell script
  • Next by Date: Re: FileMaker question
  • Previous by thread: Bytes into integer
  • Next by thread: Re: Bytes into integer
  • Index(es):
    • Date
    • Thread