Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 12.0   12.1   12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3    Statistic    FMM    Blog  

Dictionary.ToMatrix

Converts dictionary to a matrix.

Component Version macOS Windows Linux Server iOS SDK
Dictionary 13.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Dictionary.ToMatrix"; DictionaryRef )   More

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

Release notes

Blog Entries

This function checks for a paid license.

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


Dictionary.ToJSON - Dictionary.ToText

💬 Ask a question or report a problem


Start Chat