Re: Converting binary to decimal
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