• 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: Hex2Int handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hex2Int handler


  • Subject: Re: Hex2Int handler
  • From: "Arthur J Knapp" <email@hidden>
  • Date: Sat, 07 Apr 2001 19:23:48 -0400

I have recently discovered that a handler I recently posted to this
list had a very serious mistake in it, (that no one noticed,
interestingly enough). Here is an update:

property sHexParse : "0.1.2.3.4.5.6.7.8.9AaBbCcDdEeFf"

on Hex2Int(hexString)

-- hexString == [0-9A-Fa-f]+

set hexString to hexString's items's reverse

set {int, pow} to {0, 0}

repeat with char in (hexString)

set int to int + (((offset of char in sHexParse) div 2) * (16 ^ pow))

set pow to pow + 1

end repeat

return int

end Hex2Int




Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden

Hey, check out:
http://www.mainevent.com


  • Prev by Date: Amusing error message
  • Next by Date: Re: Globals are considered harmful
  • Previous by thread: Amusing error message
  • Next by thread: Why does system lock up when scripting Quark?
  • Index(es):
    • Date
    • Thread