Dictionary.ToMatrix
-------------------

Converts dictionary to a matrix.

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

MBS( "Dictionary.ToMatrix"; DictionaryRef ) 

**MBS**( **"Dictionary.ToMatrix";** /\* Converts dictionary to a matrix. \*/  
**$DictionaryRef**) /\* The reference number to the dictionary.e.g. $dic \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| DictionaryRef | The reference number to the dictionary. | $dic |

### Result

Returns matrix reference number or error.

### Description

Converts dictionary to a matrix.  
### Examples

Test dictionary to matrix conversion:

 # create new dictioanry   
Set Variable \[ $dic ; Value: MBS ( "[Dictionary.Create](DictionaryCreate.md)" ) \]   
\# add two values   
Set Variable \[ $r ; Value: MBS ( "[Dictionary.SetValueForKey](DictionarySetValueForKey.md)"; $dic ; "Hello"; "World" ) \]   
Set Variable \[ $r ; Value: MBS ( "[Dictionary.SetValueForKey](DictionarySetValueForKey.md)"; $dic ; "Some"; "Value" ) \]   
\# now make a matrix from it   
Set Variable \[ $matrix ; Value: MBS ( "Dictionary.ToMatrix"; $dic ) \]   
\# check size   
Set Variable \[ $dCount ; Value: MBS ( "[Dictionary.Count](DictionaryCount.md)"; $dic ) \]   
Set Variable \[ $mCount ; Value: MBS ( "[Matrix.Height](MatrixHeight.md)"; $matrix ) \]   
\# query values   
Set Variable \[ $mCount ; Value: MBS ( "[Matrix.GetValue](MatrixGetValue.md)"; $matrix ; 0; 0 ) \]   
Set Variable \[ $mCount ; Value: MBS ( "[Matrix.GetValue](MatrixGetValue.md)"; $matrix ; 0; 1 ) \]   
Set Variable \[ $mCount ; Value: MBS ( "[Matrix.GetValue](MatrixGetValue.md)"; $matrix ; 1; 0 ) \]   
Set Variable \[ $mCount ; Value: MBS ( "[Matrix.GetValue](MatrixGetValue.md)"; $matrix ; 1; 1 ) \]   
\# query text to check   
Set Variable \[ $$text ; Value: MBS ( "[Matrix.Text](MatrixText.md)"; $matrix ) \]   
\# cleanup memory   
Set Variable \[ $r ; Value: MBS ( "[Dictionary.Release](DictionaryRelease.md)"; $dic ) \]   
Set Variable \[ $r ; Value: MBS ( "[Matrix.Release](MatrixRelease.md)"; $matrix ) \]  
### See also

- [Dictionary.Count](DictionaryCount.md)
- [Dictionary.Create](DictionaryCreate.md)
- [Dictionary.Release](DictionaryRelease.md)
- [Dictionary.SetValueForKey](DictionarySetValueForKey.md)
- [Matrix.GetValue](MatrixGetValue.md)
- [Matrix.Height](MatrixHeight.md)
- [Matrix.Release](MatrixRelease.md)
- [Matrix.Text](MatrixText.md)

### Release notes

- **Version 13.2**
    - Added [Dictionary.ToMatrix](https://www.mbsplugins.eu/DictionaryToMatrix.shtml) function.

### Blog Entries

- [New in MBS FileMaker Plugin 13.2](https://www.mbsplugins.de/archive/2023-05-17/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.2pr4](https://www.mbsplugins.de/archive/2023-04-25/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 23th April 2023 , last changed 23th April 2023

  
[Dictionary.ToJSON](DictionaryToJSON.md) - [Dictionary.ToText](DictionaryToText.md)

[HTML Version](DictionaryToMatrix.shtml)