| View previous topic :: View next topic |
| Author |
Message |
Seffyroff Newbie

Joined: 08 Apr 2002 Posts: 15
|
Posted: Tue Apr 09, 2002 4:40 pm Post subject: Remembering Previous State |
|
|
| Is there any way I can have my program remember the previous states/selections of combo boxes, check boxes etc from the last time the program was run? Would it be done via an .ini file or some registry keys perhaps? |
|
| Back to top |
|
 |
VDSuser Contributor


Joined: 21 Mar 2002 Posts: 58 Location: Somewhere in time
|
Posted: Tue Apr 09, 2002 5:05 pm Post subject: |
|
|
Answers:
1. Yes.
2. Yes.  |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Apr 09, 2002 6:37 pm Post subject: |
|
|
There are a few ways to do this, and I'm sure everyone
has their own preferences. You can use INI files, the
registry, or a simple text file.
Heres' my opinion...
I don't like programs that mess with the registry unless
it's absolutely necessary, so I rarely (if ever) use this.
The INI file system is OK, but usually takes more code
to find and access a quantity of data, and can get flaky
with constant access.
I prefer a simple text file (named program.dat, etc.),
which can be loaded into a list at program startup. You
can use it similiar to an INI file with keys if you like, or
(as I prefer) have each value on a separate line so that
you always check @item(ListName, x) for the needed
value, and it's always in the same place. And if the user
makes modifications, a simple LIST SAVEFILE command
saves any changes.
BTW, it's a good idea to use the full path of a .DAT or .INI
file, such as @path(%0)program.dat.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Seffyroff Newbie

Joined: 08 Apr 2002 Posts: 15
|
Posted: Tue Apr 09, 2002 7:41 pm Post subject: |
|
|
Mac,
Thanks very much for your reply. I'm well into my 3rd day of using VDS now, armed with little more than a rudimentary knowledge of batch files, and of course some excellent advice from you guys.
Seffyroff. |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Apr 10, 2002 12:45 am Post subject: |
|
|
Also check into many of the example source codes on this site, as I'm sure many of them use such methods as you seek.
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
|