The Daily Click ::. Forums ::. Klik Coding Help ::. ASCII
 

Post Reply  Post Oekaki 
 

Posted By Message

easyname



Registered
  15/04/2008
Points
  450
5th January, 2009 at 19:48:46 -

For some reason I want to convert ASCII from a text box to a decimal number (base10)

Is there any way of doing this?

 
n/a

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
5th January, 2009 at 19:56:41 -

if you want the actual value, such as the ASCII string "392349" to be the number 392349, its simply:

Val("String"), which can be found in the expression editor under Special--->Conversion--->String to Number


Also Edit Boxes have this built in as the expression:

Edit Value("Text Box Name")

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

easyname



Registered
  15/04/2008
Points
  450
5th January, 2009 at 20:02:22 -

I'm thinking more converting text to numbers, which is more complex

From base 128 to base 10

EDIT: Or is there some method of getting the binary for a string, then converting that to decimal?

Edited by easyname

 
n/a

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
5th January, 2009 at 20:12:02 -

binary object, base converter too.

If they can't do what you need, worst case scenario you can just load all the ascii tables into an array or list by hand, and iterate through your string to create the ascii decimal equivalent. Might not be very efficient

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

easyname



Registered
  15/04/2008
Points
  450
5th January, 2009 at 20:51:20 -

Thanks! I've got the number generator working now

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
5th January, 2009 at 21:59:24 -

nnneeeeeeeeeeEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEOOOWWwwwwwwwww...

*whooshes hand over head*

 

  		
  		

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
5th January, 2009 at 23:55:36 -

Oooh I think that link is broken!!!

 
n/a ...
   

Post Reply



 



Advertisement

Worth A Click