Re: Looking for some advice for my program




"Ralph" <nt_consulting64@xxxxxxxxx> wrote in message
news:udxrgdbZIHA.1208@xxxxxxxxxxxxxxxxxxxxxxx

"Jan Hyde (VB MVP)" <StellaDrinker@xxxxxxxxxxxxxxxxxxx> wrote in message
news:ls39q3dig9l8u48do5a6ve9grv4vopsahi@xxxxxxxxxx
"Kardon Coupé" <prefer.to@xxxxxxxxxxxxxxxxx>'s wild thoughts
were released on Sat, 2 Feb 2008 09:41:15 -0000 bearing the
following fruit:

Dear All,

I have been thinking for a while now and can't come to a conclusion for
this
problem

I've written a program that saves settings and other information in a
.txt
file and reads it when the program loads.. up until now, when I've
upgraded
the program I've had to advise the 'testers' to uninstall and re-install
because I've added extra things and the old settings (.txt files) and
other
stuff would cause a crash, as the program is looking for one thing, and
finds something else...even when I introduced a new option, it was
easier
for me to create a new .txt file for that particular part. Ultimately I
would love everything within one file, be it a .txt file, or even a
binary
file that was as visible to the user....

What I ask, is there a fool safe way of saving information, so that any
upgrades aren't as painful?

I was thinking (if I was going to stay within the .txt file format) to
maybe
have a number system, I.e. the program reads the settings number and
dumps
it into the required setting based on the number...but I'm thinking that
may
be too complicated...

I've used many a program that you can over-upgrade and most if not all
your
settings carry over, I would like to achieve the same thing...

Hope this makes sense..

I'd agree with the other poster than an INI file would be
easier to manage. That aside, if it's causing your app to
crash then then it's your app that is at fault. I would have
though you could have coded to cater for old\new settings.


I agree.
Mr. Hyde expressed it well enough, so I'm only adding my vote.
The particular "store" is NOT the real issue. The issue is you have not
designed for flexiblity. That said, an INI would help in that one can
easily
versionize the Sections.

While you're reworking your App you are also advised to separate out these
'settings' into machine-specific (all users), user-specific, and
App-specific configurations. Or eventually *where* you store these items
will become another issue. <g>

-ralph



Man am I glad I decided to read this thread. I've had the same upgrading
issues (somewhat) with my application.

When I first started it back in 2000 (yes, its a long haul project), I was
still learning that 1+1 does not equal 3. Over time, and thanks to the great
programming folks here, I've made big leaps.

However, my program still uses a SAVE/LOAD file that is not very flexible.

Everytime I am adding a new indicator to my program, I have to add it also
to the SAVE routine so it can be saved with the other indicator settings.
But then, I must go to the LOAD routine and make sure that I load the
settings in the SAME ORDER that I saved it.

Well, that works okay, except that now users get these errors because the
last time they saved their charts, it didn't have that extra indicator
information. To fix it, they only need to click on SAVE to update the format
of their save file. But it is clearly not a good thing.

All this time, I had not thought of using an INI format. In fact, I had
completely forgotten that you use API calls to deal with them. Being simple
text files, I can only think that the API is for dealing with the 'order' of
the information, so that I do not have to. Would that be the correct
assumption?

Thx.

Webbiz


.



Relevant Pages

  • Re: Looking for some advice for my program
    ... >I've written a program that saves settings and other information in a ... I'd agree with the other poster than an INI file would be ... crash then then it's your app that is at fault. ... Everytime I am adding a new indicator to my program, I have to add it also to the SAVE routine so it can be saved with the other indicator settings. ...
    (microsoft.public.vb.general.discussion)
  • Re: Vista makes me crazy, please help.
    ... It's hardly complex to have the filename or the section name contain the user ID if that's necessary or to place the INI under the user's app data folders. ... The overhead of the registry index structure cuts into that but even if it still saves space it is a small advantage that is utterly swamped by the advantages of the individual files. ... There is some buffering on INI files as well and unless you are doing a LOT of reading and writing settings the speed just is not an issue. ...
    (microsoft.public.vb.general.discussion)
  • Re: Ini File vs Registry
    ... How do you manage the settings? ... dollars in hacking the OS to introduce the concept of registry ... Hard to migrate app ... but increasingly desktop developers are fighting it out ...
    (microsoft.public.vc.mfc)
  • Re: Deployment + Vista
    ... In my apps, they have a Server ... it's a good thing I do not use that for settings. ... In any event, when the app starts up for the first time, it checks for the ... then construct a string on the fly. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Deployment + Vista
    ... The problem is it's connection string is always ... Server settings form. ... possibly occur with a file created by your app. ... I guess it's a good thing I do not use that for settings. ...
    (microsoft.public.dotnet.framework.adonet)