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:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
Dictionary.ToText
Returns text representation of dictionary for data exchange.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| Dictionary | 6.1 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| DictionaryRef | The reference number to the dictionary as returned by Dictionary.Create function. | $dic | |
| Column Delimiter | The delimiter between key and value. Should not be part of content. By default we use tab key. |
Optional | |
| Row Delimiter | The delimiter between rows. By default we use return key (char 13) |
Optional |
Result
Returns OK or error.
Description
Returns text representation of dictionary for data exchange.Containers are just added as text and delimiters inside a text value can cause trouble.
Examples
Test exporting dictionaries:
#
#
#Create new Dictionary
#
Set Variable [$param; Value:MBS( "Dictionary.Create" )]
#
#Fill in values
#
Set Variable [$r; Value:MBS( "Dictionary.SetValueForKey"; $param; "text"; Pass Parameters with Dictionary::TextField )]
Set Variable [$r; Value:MBS( "Dictionary.SetValueForKey"; $param; "number"; Pass Parameters with Dictionary::NumberField)]
Set Variable [$r; Value:MBS( "Dictionary.SetValueForKey"; $param; "date"; Pass Parameters with Dictionary::DateField)]
Set Variable [$r; Value:MBS( "Dictionary.SetValueForKey"; $param; "time"; Pass Parameters with Dictionary::TimeField)]
Set Variable [$r; Value:MBS( "Dictionary.SetValueForKey"; $param; "timestamp"; Pass Parameters with Dictionary::TimeStampField)]
Set Variable [$r; Value:MBS( "Dictionary.SetValueForKey"; $param; "container"; Pass Parameters with Dictionary::ContainerField)]
#
#Call save xml, json and text
#
Set Variable [$r; Value:MBS( "Text.WriteTextFile"; MBS("Dictionary.ToXML"; $param; 1); MBS( "Path.AddPathComponent"; MBS( "Folders.UserDesktop" ) ; "dictionary.xml"); "UTF8")]
Set Variable [$r; Value:MBS( "Text.WriteTextFile"; MBS("Dictionary.ToText"; $param); MBS( "Path.AddPathComponent"; MBS( "Folders.UserDesktop" ) ; "dictionary.txt"); "UTF8")]
Set Variable [$r; Value:MBS( "Text.WriteTextFile"; MBS("Dictionary.ToJSON"; $param); MBS( "Path.AddPathComponent"; MBS( "Folders.UserDesktop" ) ; "dictionary.json.txt"); "UTF8")]
#
#free memory
#
Set Variable [$r; Value:MBS("Dictionary.Release"; $param)]
See also
- Dictionary.Count
- Dictionary.Create
- Dictionary.Release
- Dictionary.SetValueForKey
- Dictionary.ToJSON
- Dictionary.ToXML
- Folders.UserDesktop
- Path.AddPathComponent
- Text.WriteTextFile
Blog Entries
Created 25th February 2016, last changed 25th February 2016
Dictionary.ToJSON - Dictionary.ToXML
Feedback: Report problem or ask question.
Links
MBS Xojo Plugins