Post: GSC Hasmap / Dictionary?
07-20-2016, 02:03 PM #1
Couto
Haxor!
(adsbygoogle = window.adsbygoogle || []).push({}); I've been looking around some gsc raw files and I encountered some arrays who are "different".

Normally, you'd have an array which it's indexs are integers, like so:

    
myArray = [];
myArray[0] = "something";
myArray[1] = "somethingOther";
myArray[2] = "somethingDifferent";
myArray[3] = "somethingABitDifferent";
...


But these arrays have strings as index like so:

    
myArray = [];
myArray["something"] = 0;
myArray["somethingOther"] = 1;
myArray["somethingDifferent"] = 2;
myArray["somethingABitDifferent"] = 3;
...


In both cases I can count the ammount of indexs in myArray with:

     myArray.size 


My question is, how can I know the indexs in myArray when I don't know it's result?

For instance: In the examples above I knew that myArray["something"] is equal 0 therefore I could compare 0 to the list of arrays and get the index string.

But how can I know the string if I don't know the result?

I know the C# way is:

    foreach(KeyValuePair<T1, T2> pair in Dict)


The other question is: Is it possible to do this in GSC?
(adsbygoogle = window.adsbygoogle || []).push({});

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo