Author Topic: Listing Arrays  (Read 2245 times)

As I've stated earler, I've already made a better system for what i'm trying to do, thanks.

Alternatively, you could use something like a dictionary object to represent it, e.g.: https://gist.github.com/portify/5848325#file-object-cs

Arrays have to start with zero you would have to do something like

$this[0] = "Forest";
$this[1] = "Magic Bob's Playland";

I'm not to familiar with arrays so I may be wrong
There are no arrays in torkscript
It inserts the text in brackets into the variable name

%asdf[0] is actually %asdf0 and the same as %a["sdf0"]
That means something like %asdf["hi"] is also valid

If you have multiple insertions, like %asdf[1, 2] it will be represented by %asdf1_2

if you had to use the data structure with arrays as the names you could export all the variables and then read each line and apply it to like another array

I actually decided that a hashmap would be pretty useful so I coded up a resource to make pseudohashmaps and uploaded it here. This should explain usage adequately. I should mention that I haven't been able to test it yet, but it should work.