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:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
Creates a new dictionary.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Dictionary | 5.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
Key | Optional, a key. | Optional | |
Value... | Optional, a value. | Optional |
Returns dictionary reference number or error.
Build a dictionary in a calculation:
Let ( [
/*
Create new Dictionary
*/
param = MBS( "Dictionary.Create" );
/*
Fill in parameters
*/
r1 = MBS( "Dictionary.SetValueForKey"; param; "text"; Pass Parameters with Dictionary::TextField );
r2 = MBS( "Dictionary.SetValueForKey"; param; "number"; Pass Parameters with Dictionary::NumberField);
r3 = MBS( "Dictionary.SetValueForKey"; param; "date"; Pass Parameters with Dictionary::DateField);
r4 = MBS( "Dictionary.SetValueForKey"; param; "time"; Pass Parameters with Dictionary::TimeField);
r5 = MBS( "Dictionary.SetValueForKey"; param; "timestamp"; Pass Parameters with Dictionary::TimeStampField);
r6 = MBS( "Dictionary.SetValueForKey"; param; "container"; Pass Parameters with Dictionary::ContainerField)
/*
return dictionary
*/
] ; param )
Build a dictionary with given Keys and Values:
MBS("Dictionary.Create"; "FirstName"; $FirstName; "LastName"; $LastName; "City"; $City; "Phone"; $Phone; "Email"; $Email)
Test script to look for duplicate UUIDs:
Set Variable [ $dic ; Value: MBS( "Dictionary.Create") ]
Loop
Set Variable [ $uuid ; Value: Get(UUID) ]
If [ MBS("Dictionary.HasKey"; $dic; $uuid) ]
Show Custom Dialog [ "Duplicate!" ; $uuid ]
Exit Loop If [ 1 ]
End If
Set Variable [ $r ; Value: MBS( "Dictionary.SetValueForKey"; $dic; $uuid; $uuid ) ]
End Loop
Set Field [ test::test ; MBS( "Dictionary.Keys"; $dic ) ]
Set Variable [ $r ; Value: MBS( "Dictionary.Release"; $dic ) ]
Created 12nd December 2014, last changed 20th June 2021
Dictionary.Count - Dictionary.CreateNamed
Feedback: Report problem or ask question.