Archive 17/01/2023.

Iterating through all dictionary elements in AS

rogerdv

Seems that dictionaries are not used at all in samples, or even editor, and neither Google returns many results. How can I iterate through all the values stored in a dictionary? I guess I have to use the keys property to get all keys, as I dont see any iterator in the docs.

Azalrion
Dictionary d;
for (int i = 0; i < d.length; i++)
{
    Object@ objGet;
    d.Get(d.keys[i], @objGet);

    Object@ objOp = cast<Object>(d[d.keys[i]]);
}

urho3d.github.io/documentation/H … Dictionary