Save List.SelectedText as variable with quotation marks

Get help using Construct 2

Post » Sat Sep 02, 2017 3:55 am

Hi folks.

So, I have this dropdown list with some variables in it. Let's say Rock, Metal and Pop. I want to save the selected object in a variable that I can use as a tag.

In other words: If I click on Rock, the variable should be set to "Rock" and not Rock. That way, if I want to use the "Rock" tag in something, I can just input the name of the variable, right?

Right now I have When List clicked, set Variable to List.SelectedText

This saves the name of the text, but without the quotation marks. If I make it ""&List.SelectedText&"" it makes no difference.

So, how can I save this List.SelectedText with quotation marks to a variable?

Thanks in advance
B
14
S
4
Posts: 25
Reputation: 894

Post » Sat Sep 02, 2017 7:55 am

PSyCHoHaMSTeRza wrote: If I click on Rock, the variable should be set to "Rock" and not Rock....
So, how can I save this List.SelectedText with quotation marks to a variable?

Code: Select all
""""&List.SelectedText&""""


but I usually use an additional variable for quotation marks

Image
then I can write
Code: Select all
qM&List.SelectedText&qM


Image

PSyCHoHaMSTeRza wrote: if I want to use the "Rock" tag in something, I can just input the name of the variable, right?


in C2 you don't need quotation marks for tags if you use variable...
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Wed Sep 13, 2017 12:08 pm

Okay great, thanks!
B
14
S
4
Posts: 25
Reputation: 894


Return to How do I....?

Who is online

Users browsing this forum: sean080 and 7 guests