comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Config files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Config files [message #47412 is a reply to message #47407] Thu, 09 February 2006 07:31 Go to previous messageGo to previous message
savoie is currently offline  savoie
Messages: 68
Registered: September 1996
Member
Edd <eddedmondson@hotmail.com> writes:

> Ben Panter <me@privacy.net> wrote:
>> I would use save and restore, but start out with a batch file which can
>> do the save and restore for you. Something like this:
>
>> set_config.pro:
>
>> ;change these parts:
>> input = myinputdata.dat
>> output = myoutputwillgohere.dat
>> aconstant = 1.0
>> anarray = [1,2,3]
>
>> ;leave this alone:
>> save, input, output, aconstant, anarray, filename='settings.sav'
>
>
>> When you start a run, call @set_config and then later on in the code do
>> a restore, 'settings.sav'. I do something similar, but save the settings
>> in a struct rather than loose parameters. That way it's easier to pass
>> around to any routines that need it later on, and I'm less likely to use
>> the parameter names for something else by mistake.
>
>> Hope that's helpful,
>
> Cracking idea, and I'm kicking myself for not having thought of it!

I'm doing the same thing. That's a great idea.

I wrote a subclass of Craig Markwardt's HASHTABLE__define.pro,
mhs_iniread__define, that lets me pass a configuation file into a routine and
get back an object with pretty normal functionality.

ini = Obj_New('mhs_iniread', file='inifile.txt')

value = ini->get('value')

The only problem is that it's not that robust. I know the quirks, and I work
around them rather than fixing my code.

It's just a thought.


Matt

--
Matthew Savoie - Scientific Programmer
National Snow and Ice Data Center
(303) 735-0785 http://nsidc.org
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: help with text widget...
Next Topic: Re: IDLWave documentation generation

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 20:07:32 PDT 2025

Total time taken to generate the page: 0.88580 seconds