Dictionary.KeyAtIndex
---------------------

Returns key with given index.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Dictionary](component_Dictionary.md) | [5.0](newinversion50.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Dictionary.KeyAtIndex"; DictionaryRef; Index ) 

**MBS**( **"Dictionary.KeyAtIndex";** /\* Returns key with given index. \*/  
**$DictionaryRef**; /\* The reference number to the dictionary.e.g. $dic \*/   
**$Index**) /\* The index for the key. Range from 0 to [Dictionary.Count](DictionaryCount.md)-1.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| DictionaryRef | The reference number to the dictionary. | $dic |
| Index | The index for the key. Range from 0 to [Dictionary.Count](DictionaryCount.md)-1. | 0 |

### Result

Returns value or error.

### Description

Returns key with given index.  
Index starts at zero and ends at [Dictionary.Count](DictionaryCount.md)-1.  
### Examples

Query first key:

 MBS ("Dictionary.KeyAtIndex"; $Param ; 0)  
### See also

- [Dictionary.Count](DictionaryCount.md)

### Example Databases

- [Dictionary/Pass Parameters with Dictionary](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Dictionary/Pass%20Parameters%20with%20Dictionary.shtml#3ScriptAnchor_)

This function checks for a license.

Created 12nd December 2014 , last changed 9th November 2021

  
[Dictionary.HasKeys](DictionaryHasKeys.md) - [Dictionary.Keys](DictionaryKeys.md)

[HTML Version](DictionaryKeyAtIndex.shtml)