• 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: Doug McNutt <email@hidden>
  • Date: Fri, 13 Feb 2004 07:07:17 -0700

At 08:31 -0500 2/13/04, Steve Roy wrote:
>int off = (b1 << 16) + (b2 << 8) + (b3 << 0);
>
>But I don't know any way in vanilla AppleScript to do bitwise operation like the
>Java code does. Is there a clever trick to do this?

= b1 * 2^16 + b2 * 2^8 + b3

= ((b1 * 256) + b2) * 256 + b3

But does AppleScript use unsigned chars? Or will bytes > 127 be treated as negative values?

--
--> There are 10 kinds of people: those who understand binary, and those who don't <--
_______________________________________________
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.

  • Prev by Date: Re: Finding out is an Application is running
  • Next by Date: Re: do shell script
  • Previous by thread: Re: Bytes into integer
  • Next by thread: Re: Bytes into integer
  • Index(es):
    • Date
    • Thread