gettcldict

Imports the Tcl dictionary to the OML variable.

Syntax

[omlvariablename,status,errormessage] = gettcldict (tclvariablename, key)

Inputs

tclvariablename
Any valid Tcl variable name as a string.
Type: string
key (optional)
Key of the element in the dictionary. If key is not provided, then entire dictionary will be return as output.
Type: string

Outputs

omlvariablename
Any valid OML variable name.
Type: struct | logical | number | string
Tcl Variable Type OML Variable Type Limitations
Dictionary Struct Keys in the dictionary should be string or char. Values in the dictionary should be Bool, Int, Double, or String. Other type of values are exported as strings.
status
Status of importing the Tcl dictionary value to the OML variable.
1 = success
0 = failure
Type: number
errormessage
Error message indicating the failure.
Type: string

Example

[status,errormessage]=evaltclscript('set mydictionary [dict create k true key2 1 key3 2.2 key4 "4"]');
[omlvariablename,status,errormessage]=gettcldict  ('mydictionary')
omlvariablename = struct [
k: 1
key2: 1
key3: 2.2
key4: 4
]
status = 1
errormessage =