ListKeys
(Engine-Level Function)
| Description | Returns an array of all keys used within a dictionary. Use this to discover what is in a dictionary. |
| Returns | Array |
| Usage | Script Only. |
| Function Groups | Dictionary, Variable |
| Related to: | Dictionary | MetaData | DictionaryCopy | DictionaryRemove | GetNextKey | GetKeyCount |
Format: ![]() |
ListKeys( dictionary[, order, return value ]); |
| Parameters | |
| Dictionary | ||||||||||||
| Required. The name of the dictionary. | ||||||||||||
| Order | ||||||||||||
An optional numeric expression. Defines the search according to the following table of values. Defaults to 0 if missing or invalid
|
| Return Value | ||||||||||||
Controls what is returned according to the following table. Defaults to 1.
|
| Comments: | To get the number of keys in a given dictionary only, GetKeyCount is more suitable. |
Example 1:
(given a dictionary named X as shown in the following image)
R = ListKeys( X ); R == ["A", "B", "C"];
Example 2:
Given the code:
If Watch(1);
[
X = Dictionary();
X["A"] = 42;
X["B"] = 86;
X["C"] = 99;
Buf = ListKeys(X, 1, 3);
]
Buff will contain:
