Dictionary Questions

0 favourites
  • 6 posts
  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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 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.

  • 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.

  • Cool, thanks for the Magistross

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)