Ok, after my lack of success in the last thread I'm attempting to build an associative array manually. (Hopefully with more functionaility too, like being able to iterate through it.)
What I want to achieve is standard in OOP, but i'm not sure whether it's possible in GS.
The code will hopefully make more sense:
PHP Code:
function array(indexes,values) {
this.inds = indexes;
this.vals = values;
this.item = item();
return this;
}
function item(ind) {
return this.vals[this.inds.index(ind)];
}
//then use like:
arr = array({"a","b","c"},{"one","two","three"});
var = arr.item("b"); //var should be "two"
Is this kind of thing possible? I'm trying to achieve some pretty basic OO functionality.
If this is possible it'd really help me with a lot of scripts.
Thanks.