Dictionary.HasKey
-----------------

Checks if the given key exists in dictionary.

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

MBS( "Dictionary.HasKey"; DictionaryRef; Key ) 

**MBS**( **"Dictionary.HasKey";** /\* Checks if the given key exists in dictionary. \*/  
**$DictionaryRef**; /\* The reference number to the dictionary.e.g. $dic \*/   
**$Key**) /\* The key to use. Keys are case sensitive. Also keys must be text and should be single line.e.g. "FirstName" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| DictionaryRef | The reference number to the dictionary. | $dic |
| Key | The key to use. Keys are case sensitive. Also keys must be text and should be single line. | "FirstName" |

### Result

Returns 1, 0 or error.

### Description

Checks if the given key exists in dictionary.  
### Examples

Checks if some values are there:

 $hasText = MBS ("Dictionary.HasKey"; $Param ; "text")  
$hasFun = MBS ("Dictionary.HasKey"; $Param ; "fun")  
### See also

- [Dictionary.Create](DictionaryCreate.md)
- [Dictionary.HasKeys](DictionaryHasKeys.md)
- [Dictionary.Keys](DictionaryKeys.md)
- [Dictionary.Values](DictionaryValues.md)

### Release notes

- **Version 14.2**
    - Added [QuickList.HasValues](https://www.mbsplugins.eu/QuickListHasValues.shtml) and [Dictionary.HasKeys](https://www.mbsplugins.eu/DictionaryHasKeys.shtml) functions.

### 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 1st March 2021

  
[Dictionary.GetTag](DictionaryGetTag.md) - [Dictionary.HasKeys](DictionaryHasKeys.md)

[HTML Version](DictionaryHasKey.shtml)