Re: Library/Functions to write configuration file for application [message #74744 is a reply to message #74743] |
Mon, 31 January 2011 11:44   |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
I have some very old routines I wrote for exactly that purpose. They
worked with text files, recognizing a few comment markers, and
optionally converting the values to numbers (reals or integers) if
they are compatible with being numbers. I can tidy them up and publish
them, maybe later tonight. They fit well into some classes I was
preparing.
Another approach I used for the same purpose is NetCDF files, which
nicely handle names dimensions and types, and can be easily put into
hashes or structures. Writing takes slightly more work, due to the
need to associate dimensions with the variables, but can also be
nicely expressed by hashes.
On Jan 31, 5:05 pm, Robin Wilson <ro...@rtwilson.com> wrote:
> What I was wondering is whether there are any libraries/sets of
> functions in IDL that would help with reading and writing these
> configuration files? I know that a number of programming languages
> either have inbuilt functions for writing configuration files or some
> add-ons which do that - do any of these exist for IDL?
>
> I could knock up some simple file reading/writing code, but that would
> make it rather difficult if I changed the order/number of variables in
> the file, as I'd probably have to read some lines as strings and some as
> floats, ints etc, and I could see it getting very complicated and
> difficult to maintain.
|
|
|