next up previous
Next: Running WOM stand-alone
Up: The WOM language
Previous: Dynamic attribute assignments

Reading and writing data files

Every instance has readDataFromStream and writeDataToStream methods. The second is usually applied to forms, causing them to write the data from all their fields to a stream:

IncomeTax.TaxRate = 25
IncomeTax.TaxBands = 3
WOM writes out the data one entry per line, as a path/value pair.

readDataFromStream reads back data into an instance. Both methods have options for controlling the format of paths, what to do if a path that doesn't exist is read, and so on. Our economic models (written in Modula-2) have a library of routines for reading and writing files in this format, so it is easy to pass data to and from these programs. We also have special classes for merging WOM data files and for storing the data in memory.

Jocelyn Ireson-Paine
Fri May 30 14:03:06 BST 1997