Reputation: 59
I am using tcl/java where I am trying to create some TCLDict object and setting that dictionary object to a dictionary variable in tcl script using setVar from TCLInterpreter. Could someone guide me how to create a TCLDictionary and setting it using setVar in JAVA?
Thanks in advance.
Upvotes: 0
Views: 170
Reputation: 2661
You could try to use setVar to create a text string of the serialized dictionary. Here's a simple dictionary tcl. I image if you setVar the dictionary you could use the getter in tcl.
testdict.tcl
#!/usr/bin/tclsh
dict set addresses home "Maple Street"
dict set addresses office "Downtown"
puts $addresses
puts [dict get $addresses office]
output:
./testdict.tcl
home {Maple Street} office Downtown
Downtown
So in thiis case I image a setVar("addresses", "home {Maple Street} office Downtown") or whatever the syntax may be should get you a dictionary in tcl.
Upvotes: 0