• 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: Binary => decimal conversion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binary => decimal conversion


  • Subject: Re: Binary => decimal conversion
  • From: email@hidden
  • Date: Mon, 27 Nov 2000 14:49:52 EST

--here is a sample. it only goes to 8-bit(0-255), but you can make it longer
by following the pattern:

set d to 1
set e to 0
set c to the text returned of (display dialog "Enter an 8 bit binary number"
default answer "00000000")
if item 1 of c is "1" then
set e to (e + 128)
end if
if item 2 of c is "1" then
set e to (e + 64)
end if
if item 3 of c is "1" then
set e to (e + 32)
end if
if item 4 of c is "1" then
set e to (e + 16)
end if
if item 5 of c is "1" then
set e to (e + 8)
end if
if item 6 of c is "1" then
set e to (e + 4)
end if
if item 7 of c is "1" then
set e to (e + 2)
end if
if item 8 of c is "1" then
set e to (e + 1)
end if
display dialog e


  • Prev by Date: Re: closing MSWord files
  • Next by Date: RE: PostScript files from QuarkXPress
  • Previous by thread: Re: Binary => decimal conversion
  • Next by thread: Re: [unplgd] Trimming " clipping" from clipping file names
  • Index(es):
    • Date
    • Thread