Vaules in strings

For questions about using Classic.

Post » Sun Jun 28, 2009 1:43 pm

Well, i want to have a text that can handle values, for example something like this:
"The number of the run is" random(5) ", Yay!"

I know the example is invalid, but i want it to be something like this. Can someone help me?
B
2
G
3
Posts: 17
Reputation: 884

Post » Sun Jun 28, 2009 1:49 pm

Try plus (+) for concatentate and str( number ) to convert from value to string:
[code:27z64wsd]"Value = " + str(random(5)) + "! :-)"[/code:27z64wsd]
B
6
S
3
G
6
Posts: 219
Reputation: 3,013

Post » Sun Jun 28, 2009 8:17 pm

If you use the text concatenator & then you don't need to use str(). It's converted automatically.

Like so:

[code:2oybl3oj]"Value = " & random(5) & "! lol"[/code:2oybl3oj]
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Jun 28, 2009 11:13 pm

"its true..."&newline&"no seriously"
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Jun 29, 2009 3:01 am

I always use "lol" + "text" the & symbol disturbs me
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests