gettclarray

Imports the Tcl array to the OML variable.

Syntax

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

Inputs

tclvariablename
Any valid Tcl variable name as a string.
Type: string
key (optional)
Key of the element in the array. If key is not provided, then entire array 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
Array Struct Keys in the array should be string or char. Values in the dictionary should be Bool, Int, Double, String. Other types of values are exported as strings.
status
Status of importing the tcl array value to the OML variable.
1 = success
0 = failure
Type: number
errormessage
Error message indicating the failure.
Type: string

Example

[status,errormessage]=evaltclscript('array set myArray {k true key2 1 key3 2.2 key4 "4"}');
[omlvariablename,status,errormessage]=gettclarray('myArray')
omlvariablename = struct [
k: 1
key2: 1
key3: 2.2
key4: 4
]
status = 1
errormessage =