“This column shows some simple but powerful techniques to make
TCL data persistent in a text file and to parse it again from the
file at a later point. We make use of TCL’s flexible syntax to make
the data files easily readable and even editable.”
“A typical TCL script stores its internal data in lists and
arrays (the two primary data structures in TCL). Suppose you want
to write a TCL application that can save its data on disk and read
it back again. For example, this allows your users to save a
project and load it back later. You need a way to write the data
from the place where it is stored internally (lists and arrays) to
a file. You also need a way to read the data back into a running
script.”
“You can choose to store the data in a binary form or in a text
file. This paper is limited to textual data file formats. We will
look at a number of possible formats and how to parse them in TCL.
In particular, we will show some simple techniques that make text
file parsing a lot easier.”
“This paper assumes that you are familiar with TCL, and that you
have written at least a few simple scripts in TCL.”