[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

TCL/TK Data structures- URGENT

Posted on 2005-04-29
5
Medium Priority
?
241 Views
Last Modified: 2012-05-05
Hi,

Does anybody know how to save data entries in a list data structure in tcl/tk? or some other way? i have a small form with some text widgets and i want to save the contents in a file so that i can load the file in future..

All help appreciated.
0
Comment
Question by:Jaysri
  • 2
3 Comments
 

Author Comment

by:Jaysri
ID: 13894508
Actually i mean - how to dump the contents of text widget to a file, for later use? Please respond if you know..
0
 
LVL 7

Accepted Solution

by:
CajunBill earned 2000 total points
ID: 13905757
Jaysri,
You can use the "open" and "puts" commands from tcl.
For example if you have a widget like:
entry .base -textvariable base

Then you can save the data to a file named "abc" by:
set fileid [open abc w]
puts $fileid $base
close $fileid

Later on you can read this back from file "abc" into a variable named "newbase" by
set fileid [open abc r]
gets $fielid newbase

HTH
Bill
0
 
LVL 7

Expert Comment

by:CajunBill
ID: 15542663
Fine by me!
Jaysri, I hope it helped.
CB
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses
Course of the Month17 days, 14 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question