Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Dictionary.ToMatrix
Converts dictionary to a matrix.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Dictionary | 13.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
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" ) ]
# add two values
Set Variable [ $r ; Value: MBS( "Dictionary.SetValueForKey"; $dic; "Hello"; "World" ) ]
Set Variable [ $r ; Value: MBS( "Dictionary.SetValueForKey"; $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"; $dic) ]
Set Variable [ $mCount ; Value: MBS( "Matrix.Height"; $matrix) ]
# query values
Set Variable [ $mCount ; Value: MBS( "Matrix.GetValue"; $matrix; 0; 0 ) ]
Set Variable [ $mCount ; Value: MBS( "Matrix.GetValue"; $matrix; 0; 1 ) ]
Set Variable [ $mCount ; Value: MBS( "Matrix.GetValue"; $matrix; 1; 0 ) ]
Set Variable [ $mCount ; Value: MBS( "Matrix.GetValue"; $matrix; 1; 1 ) ]
# query text to check
Set Variable [ $$text ; Value: MBS( "Matrix.Text"; $matrix) ]
# cleanup memory
Set Variable [ $r ; Value: MBS( "Dictionary.Release"; $dic ) ]
Set Variable [ $r ; Value: MBS( "Matrix.Release"; $matrix ) ]
See also
- Dictionary.Count
- Dictionary.Create
- Dictionary.Release
- Dictionary.SetValueForKey
- Matrix.GetValue
- Matrix.Height
- Matrix.Release
- Matrix.Text
Release notes
- Version 13.2
- Added Dictionary.ToMatrix function.
Blog Entries
This function checks for a license.
Created 23th April 2023, last changed 23th April 2023