Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: nFighter on June 10, 2018, 05:49:49 PM

Title: ArrayMaker/HashTable - Wrong usage?
Post by: nFighter on June 10, 2018, 05:49:49 PM
Hey! I'm a big fan of ArrayMaker and use it a lot. But suddenly I have an issue...

I can put different variables types to one hash table: couple of strings, some bools, integers, e.t.c. And I can work perfectly with this hash table until I need to iterate through all the data pairs.  :-\
Hash Table Get Next action just stop if I don't declare Type and Result values. But I obviously have an error if I declare type (because I got different types inside)

(https://i.imgur.com/RgTjqN2.png)

Did I do something wrong? Am I not allowed to save different types to one table or get next action should work different?

PS. For now I save all the keys to a separate array (Hash Table Keys action) and iterate this array instead of working with HashTable directly. But I feel like I'm increasing the entropy and produce unhealthy, overcoded solution...
Title: Re: ArrayMaker/HashTable - Wrong usage?
Post by: jeanfabre on June 11, 2018, 03:21:32 AM
Hi,

 yes, you are hitting a limitation of custom actions as they are...

and you are right, the solution is to iterate the keys and get the value for a particular key manually, because indeed they differ in types.

 so all is well, you can use your key list to iterate with, it's perfectly valid, but more complex, I give you that.

 Bye,

 Jeab
Title: Re: ArrayMaker/HashTable - Wrong usage?
Post by: terri on June 11, 2018, 07:28:30 AM
It'd likely be possible to mash Hash Table Get Next and Hash Table Get Type together, but since you need a variable to store the result and it could be any type, you'd end up having to set a variable for every type possible and that doesn't sound right... maybe picking a type and skipping the key if that doesn't match the type could work better.