Display private variables in a string

For questions about using Classic.

Post » Wed Jan 16, 2008 6:52 am

Hello there! I've got a string, with a coupple of private variables. I want it to display it's own variables in the string, how do i do that. When i try to write an expression, it just displays the expression. I'm soure it's someting simple.. i just can't come up with it right now.
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Wed Jan 16, 2008 12:30 pm

[quote="Attan":rh0u3ykq]Hello there! I've got a string, with a coupple of private variables. I want it to display it's own variables in the string, how do i do that. When i try to write an expression, it just displays the expression. I'm soure it's someting simple.. i just can't come up with it right now.[/quote:rh0u3ykq]
I assume you meant a text object.

Just reference it with Text('varname') outside of quotes in the set text function (you must use the set text function to include variables I believe)
B
3
S
2
G
4
Posts: 130
Reputation: 1,735

Post » Wed Jan 16, 2008 12:55 pm

Easiest way:

"Myvalue is: " & Sprite('Myvalue') & " and Othervalue is: " & Sprite('Othervalue')
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests