"keyAt" (mapping::keyAt)
Returns the key at the given index position.
Synopsis
T mapping.keyAt(uint idx);
Parameters
| Parameter | Description |
|---|---|
| idx | 0-based index position in the mapping. |
Description
Returns the key at the given 0-based index position. The index must be in the range 0 to count() - 1.
Tip:
Unlike the standalone
mappingGetKey() function which uses 1-based indexing (like dyn arrays), keyAt() uses 0-based indexing.Example
main()
{
mapping m = makeMapping("city", "Vienna", "country", "Austria", "population", 1900000);
DebugN(m.keyAt(0)); // "city"
DebugN(m.keyAt(2)); // "population"
}
Assignment
Mapping
