Dictionary Questions

Get help using Construct 2

Post » Fri Sep 04, 2015 5:24 pm

Why is there no easy way to say in a for-each loop

if key == "" do this to value?

That seems like such a basic, but necessary bit to have. This would be done in 8 lines of php and an associative array. I'm trying not to hate Construct, but it's hard. Such simple things should not be so hard to figure out, or left out. They're important.

Why would you want to loop through something only to do something with EVERY key, when almost EVERYONE, is going to want to do something with specific keys?

can someone help me with this?
B
7
S
2
Posts: 92
Reputation: 663

Post » Fri Sep 04, 2015 5:31 pm

not sure I follow you. "do something with EVERY key, when almost EVERYONE, is going to want to do something with specific keys?"

why would you want to do or even keep empty keys in dictionary? if you don't need it just remove it.
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 36,003

Post » Fri Sep 04, 2015 5:34 pm

I don't understand your rant, this is something easily done in Construct.

For each key in Dictionary
+Compare two values : Dictionary.CurrentKey == "something"
-->Do something with the value at this key
B
76
S
31
G
27
Posts: 1,015
Reputation: 20,790

Post » Fri Sep 04, 2015 5:57 pm

Magistross wrote:I don't understand your rant, this is something easily done in Construct.

For each key in Dictionary
+Compare two values : Dictionary.CurrentKey == "something"
-->Do something with the value at this key


I get ya. Right easy. Sorry. The thing is I'm not used to these events, and what they mean yet. Honestly, this would have been easier if this was located in the dictionary... like event from dictionary for each key, sub event from dictionary compare current key value... That would have made navigating it easier :)

Thanks again.
B
7
S
2
Posts: 92
Reputation: 663

Post » Fri Sep 04, 2015 7:28 pm

JeremyBenson11 wrote:Honestly, this would have been easier if this was located in the dictionary... like event from dictionary for each key, sub event from dictionary compare current key value... That would have made navigating it easier :)

I rightfully agree with you. It's weird that the object expose the expressions "currentkey" and "currentvalue", but only expose the "Compare current value" condition.
B
76
S
31
G
27
Posts: 1,015
Reputation: 20,790

Post » Fri Sep 04, 2015 9:50 pm

Cool, thanks for the Magistross :)
B
7
S
2
Posts: 92
Reputation: 663


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests