Text Stuff

Started by asdfchlwnsgy1236, April 17, 2014, 04:31:23 AM

Previous topic - Next topic

asdfchlwnsgy1236

I would like for a CRPL Tower to display some text on mouse-over.
The problem is that the Text commands do not seem to like having numbers as arguments.
Is there a way to convert a number to a String?
I know there is type-casting in other languages, but I don't know about this kind of programming language....
Note: The number changes during gameplay so I can't just set it to be a constant in the once endonce block.

planetfall

Have you tried <-number "" concat?
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

knucracker

Types in CRPL auto coerce.  That means you can treat a number as a string and it will just work.  For instance

42 ->num
SetPopupText(<-num)


Or if you want to construct a more complex string concat things together.  The concat command pops two items from the stack, coerces them both as strings, and pushes a single merged string back to the stack.


GetUpdateCount ->num
SetPopupText("Update Count: " <-num concat)