The Daily Click ::. Forums ::. Klik Coding Help ::. Mixed string and numbers problem
 

Post Reply  Post Oekaki 
 

Posted By Message

Tristan Clark



Registered
  28/07/2003
Points
  159
18th August, 2003 at 00:04:53 -

Hey guys,
Is there any way to get around this:
I want an edit object to display something like 'Character takes X damage', where X will be different each time depending on how much damage is actually dealt. However, after putting in something like "Character takes " + value("Damage dealt")+ "damage.", it just comes up with a message saying 'mixed strings and numbers'.
Is there any way to fix this prob? Cheers.

 
n/a

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
18th August, 2003 at 01:07:50 -

There are conversions for string to value and value to string. Str$() converts a value to a string, and you can use val() to convert a string to a number, as long as the string contains numbers; otherwise it is counted as 0. These conversions and many others can be found under the special expressions, and some on the mmf expression editor.

-Andy

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Tristan Clark



Registered
  28/07/2003
Points
  159
18th August, 2003 at 01:28:34 -

Ah, gotcha. Cheers.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click