• 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: Converting binary to decimal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting binary to decimal


  • Subject: Re: Converting binary to decimal
  • From: Håvard Graudo <email@hidden>
  • Date: Wed, 5 Jan 2005 17:00:37 +0100

Has anyone ever written a handler to convert binary to decimal?

Here is one that uses plain vanilla Applescript; it's slower that calling a shell script, though. Most of the code is to validate that the value is actually a binary number.


[...]

		repeat with testchar in testresult
			if testchar is not in testset then
				set goodinput to false
			else
				set goodinput to true
			end if
		end repeat


This actually only test the last character of the input, so any input that ends with either 0 or 1 will pass as valid. An "exit repeat" line before 'else' is needed.

Håvard
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Converting binary to decimal (From: Bernardo Hoehl <email@hidden>)
 >Re: Converting binary to decimal (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Netter's Dinner @ Macworld SF
  • Next by Date: Re: Applescript-users Digest, Vol 2, Issue 5
  • Previous by thread: Re: Converting binary to decimal
  • Next by thread: Re: Converting binary to decimal
  • Index(es):
    • Date
    • Thread