Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

Dictionary.Deserialize

Restores a serialized dictionary.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Dictionary 5.2 Yes Yes Yes Yes Yes

MBS( "Dictionary.Deserialize"; Text )

Parameters

Parameter Description Example value
Text The serialized data as text.

Result

Returns dictionary reference number or error.

Description

Restores a serialized dictionary.

Examples

Create a dictionary and serialize it:

Set Variable [$list; Value:MBS( "Dictionary.Create"; "Hello"; "World"; "1234"; "Just a test!")]
Set Variable [$text; Value:MBS("Dictionary.Serialize"; $list)]
Set Variable [$SecondList; Value:MBS("Dictionary.Deserialize"; $text)]
Show Custom Dialog ["List"; "Encoded: " & $text & ¶ & ¶ & "Decoded Keys: " & MBS("Dictionary.Keys"; $secondList) & ¶ & ¶ & "D…]
Set Variable [$r; Value:MBS("Dictionary.Release"; $list)]
Set Variable [$r; Value:MBS("Dictionary.Release"; $secondList)]

Serialize and unserialize with date and time:

# Create Dictionary
Set Variable [$dict; Value:MBS ( "Dictionary.Create" )]
# put date and time inside:
Set Variable [$r; Value:MBS ( "Dictionary.SetValueForKey"; $dict; "theTime"; Get ( CurrentTime ))]
Set Variable [$r; Value:MBS ( "Dictionary.SetValueForKey"; $dict; "theDate"; Get ( CurrentDate ))]
# Serialize this
Set Variable [$dictEncoded; Value:MBS ( "Dictionary.Serialize"; $dict )]
#Free dictionary
Set Variable [$r; Value:MBS ( "Dictionary.Release"; $dict )]
# Unpack it:
Set Variable [$newDict; Value:MBS ( "Dictionary.Deserialize"; $dictEncoded )]
# and get values
Set Variable [$TheTime; Value: MBS ( "Dictionary.ValueForKey"; $newDict; "theTime" )]
Set Variable [$TheDate; Value: MBS ( "Dictionary.ValueForKey"; $newDict; "theDate" )]
Show Custom Dialog [$TheTime & " " & $TheDate]
Set Variable [$r; Value:MBS ( "Dictionary.Release"; $newDict )]

See also

Example Databases


Dictionary.Create   -   Dictionary.HasKey

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins