Moving Values from HashTables to Arrays

For questions about using Classic.

Post » Tue Apr 02, 2013 11:36 pm

I've had a thread about this before that ended up getting too confusing because it was about my project as a whole.

I have created a simple project to illustrate what I am trying to get working. You can download that here:

https://dl.dropbox.com/u/69407974/hashtable%20to%20array%20conversion.cap

Basically, I am moving the contents of an array to a hashtable, by creating keys for each X of my array, then putting the value inside it. When the load button is pressed I want to set the values in Array back to their corresponding ones stored in the HashTable.

As it stands, the array just ends up loading nothing.

Why not use a HashTable instead of an array? I will be storing lots of other stuff in the HashTable as well, and that would end up breaking a lot of other things.

Thanks for any and all input into this!crowtongue2013-04-02 23:37:24
B
7
S
2
Posts: 123
Reputation: 1,061

Post » Wed Apr 03, 2013 5:27 pm

I changed 1 action. I'm not sure this is the best solution but it works. :)

https://www.dropbox.com/s/ygln52tpqfpbwea/hashtable%20to%20array%20conversion.cap
B
7
S
2
G
1
Posts: 21
Reputation: 692

Post » Thu Apr 04, 2013 6:11 pm

This is extremely helpful! Thank you.

There are two other parts to this I need to get working, but the main thing that is holding me back is I am trying to convert this so it can work with both the X and Y coordinates of an array.

In the example I posted the array size was 50 x 1 x 1. I'd like it to be able to be 50 x 50 x 1. For some reason I can't seem to get it to fill the hash table properly like this, since I have to use a numbering system like HashTable("31,32").
B
7
S
2
Posts: 123
Reputation: 1,061

Post » Thu Apr 04, 2013 9:26 pm

Now 50*50*1 array can fill the hash table properly. ;)

https://www.dropbox.com/s/5yugk6p0eqfum5q/hashtable%20to%20array%20conversion%28edit%29.cap
B
7
S
2
G
1
Posts: 21
Reputation: 692


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests