0

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.

1 Answers1

0

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.

wolfhammer
  • 2,641
  • 1
  • 12
  • 11
  • Thanks for the reply. This is example to create in TCL script. Can you please give me some example of how to create in JAVA programming using TCLDict. – Viswanath Duddu Jan 13 '15 at 08:33