[Plugin] Hash table

Post your completed addons to share with the community

Post » Wed Mar 06, 2013 2:27 pm

@rexrainbow Thanks, but I found an way to do what I needed using your plugin. I used the following:

For "" from 1 to Hash.ItemCnt("")
     do something with Hash.At((loopindex - 1) & ".id")
     do other things with Hash.At((loopindex - 1) & ".name")
RedDragon2013-03-06 14:28:46
B
7
S
1
Posts: 7
Reputation: 839

Post » Wed Mar 06, 2013 2:32 pm

@mchulet Check my previous post on this thread, I think you can use:

For "" from 1 to Hash.ItemCnt("Question")
    do something with Hash.At("Question." & (loopindex - 1) & ".Sentence")
B
7
S
1
Posts: 7
Reputation: 839

Post » Wed Mar 06, 2013 2:57 pm

@RedDragon

Great! I forgot that.
It is not design for list object, never mind, it could be used in this case, cool.
B
108
S
26
G
250
Posts: 4,403
Reputation: 141,123

Post » Thu Mar 07, 2013 12:22 am

Update

Now expression:ItemCnt will return list length directly.

Here is a sample capx to iterate a list object.
The content of this list is provided by @RedDragon
B
108
S
26
G
250
Posts: 4,403
Reputation: 141,123

Post » Thu Mar 07, 2013 1:06 pm

That worked for me, Thanks RedDragon,rexrainbow.
B
13
S
3
Posts: 76
Reputation: 1,679

Post » Tue Mar 26, 2013 3:31 pm

Hello, I'm having trouble with arrays using the HashTable. I basically want to take an array from my JSON file which I load from an external URL, and place all the items in an array in construct2. My array from my JSON file looks like this:

{
   "en": ["word1", "word2", "word3", "word4", ... "word103"]
}

From the trial and error i've done, when I set my debug text to HashWords.ItemCnt("en") it appears as 103, so it's noticing that there's 103 items in the JSON array. However, I don't know how to get those words, and put them into an array in construct, all on the X-axis.

Thank you for any help.
B
12
S
1
Posts: 29
Reputation: 908

Post » Tue Mar 26, 2013 11:21 pm

@Rogalog

To put array into array object, see this and this.
B
108
S
26
G
250
Posts: 4,403
Reputation: 141,123

Post » Thu Mar 28, 2013 2:28 pm

@rexrainbow

Awesome, thanks dude. Turns out I was using CurKey, instead of CurValue which was my main problem. Rogalog2013-03-28 14:28:40
B
12
S
1
Posts: 29
Reputation: 908

Post » Fri Apr 05, 2013 12:36 am

Update

Support save/load system (r124)
B
108
S
26
G
250
Posts: 4,403
Reputation: 141,123

Post » Sat Apr 27, 2013 12:36 pm

How can I append a hash table. I have two tables one that has the loaded ajax call and another that's the stored table. As I want to check the server every few mins for updates and push them into the stored table.

I have tried to use the merge but that's not giving me the correct results as it overwrites current keys rather than appending them.

Also tried to use set value and ussing itemkeycount to get last root key and set value from loaded hash table but I get \ in the json.
B
25
S
11
G
5
Posts: 140
Reputation: 5,029

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests