Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Display the cursors position
Josh Chunick's Personal Site
Fill using setPixel
Set Cast member Properties of a QuickTime
RealLingo
Install-us Pro
Magic Button
Delete one or more items
moving buttons
Direct FTP 2.0
 

 

 

Behavior Convert between bases-Integer to String

Added on 6/27/2000

 

Compatibilities:
D7 D8 Mac PC Script Shockwave

Rating:

Author: JoergSeibert

Converts an integer to a string based on a set base

--Based on scripts by Kevan Dettelbach and Chuck Neal

--Convert a positive integer in a String based on base
-- for int-to-hex call ConvBase(nConv, 16)
-- for int-to-bit call ConvBase(nConv, 2)
on convBase nConvNum, nBase
  if (nBase > 1 and nBase < 17) and (nConvNum > -1) then
    baseNums = ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"]
    szConverted = ""
    repeat while nConvNum
      nMod = nConvNum mod nBase
      szConverted = baseNums[nMod + 1] & szConverted
      nConvNum = nConvNum / nBase
    end repeat
    return szConverted
  else
    return VOID
  end if
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail