How do I use variables within dictionary expressions

Get help using Construct 2

Post » Sat Jan 10, 2015 11:05 pm

Can't I use a variable inside of a dictionary expression like this: Dict_XYZ.Get("XABCD Number")?

That's what I'm trying to do:

->Repeat X times.
--> add to TOTAL (Dict_XYZ.Get("XABCD Number"))
-->set Number to Number+1

I want to retrieve all values which start with the key "XABCD"
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Sat Jan 10, 2015 11:39 pm

Sure just append the variable to the end of the key name:
Dict_XYZ.Get("XABCD " & Number)
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,670

Post » Sun Jan 11, 2015 12:01 am

ramones wrote:Sure just append the variable to the end of the key name:
Dict_XYZ.Get("XABCD " & Number)



I though I couldn't do that with dictionaries. Sorry for such an stupid question. :lol:
B
56
S
21
G
3
Posts: 602
Reputation: 6,612


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 25 guests