| View previous topic :: View next topic |
| Author |
Message |
wezel Freshman
Joined: 09 Oct 2003 Posts: 30
|
Posted: Oct 13th, 2003 04:59 PM Post subject: Registery or .dat ? |
|
|
Hi,
Recently I saw a small code to store information in the registery:
savesetting()
I thought accessing the registery needs lots of API calls and code I don't understand...
I'm making a program that keeps reminders in a dat file
(app.path & \reminders.dat) and retrieves them with the GetPrivateProfileStringA API call
Now I was thinking, would it be better and/or faster to store the reminders in the register ?
This is the way they're now stored in a dat file (this is the dat file with 2 reminders):
[03-04-2007]
reason=here comes the reason
wave=C:\Programmatie\Visual Basic\Source Codes\Reminder\Opeth - Moonlapse Vertigo.wav
[03-03-2005]
reason=and another reason
wave=C:\Programmatie\Visual Basic\Source Codes\Reminder\sound\sound.wav
I'd also like to thank everyone from the forum for the fast & very helpfull replies I've received for my previous questions
Thank you!
Wesley _________________ Real Programmers don't comment their code - it's hard to write, it should be hard to read |
|
| Back to top |
|
Avis Junior Poster

Joined: 07 Oct 2003 Posts: 510 Location: India
|
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 14th, 2003 07:00 AM Post subject: |
|
|
Well with SaveSetting and GetSetting it is very easy to access the registry but there is one restriction : where it actually saves the data. But there are a lot of modules for accessing the registry and it becomes just as easy as SaveSetting and GetSetting! If you want I can post one so you can look through it
Philip _________________ No one is completely useless. They can at least be an example of what to avoid.
Last edited by P.T.A.M. on Oct 14th, 2003 07:02 AM; edited 1 time in total |
|
| Back to top |
|
wezel Freshman
Joined: 09 Oct 2003 Posts: 30
|
Posted: Oct 14th, 2003 08:10 AM Post subject: |
|
|
That would be very kind, thank you.
I've also got an easy module to access the registery: the program makes a file .reg, adds the information to the file and then opens it so it adds the contents to the registery; but i'm guessing this is slower...
I would be very gratefull if you could post me an example of the normal way to access the registery! My project should add itself to 'Run At Startup' so i got to know it anyway...
Thank you.
Wesley _________________ Real Programmers don't comment their code - it's hard to write, it should be hard to read |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 14th, 2003 10:34 AM Post subject: |
|
|
Don't mention it :o  _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
Tsudeki Newbie
Joined: 09 Apr 2004 Posts: 10
|
Posted: May 12th, 2004 07:21 PM Post subject: |
|
|
P.T.A.M., can you repost the modregistry file? In my current project I use SaveSetting and GetSetting to determin a few things: has the program ever been run? What skin does the user prefer? things like that...Since it's only a few registry entries I didn't think it necessary to have a separate .dat file or .ini...ah..anyway, lol...if you could repost that file I'd be grateful.  |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: May 13th, 2004 09:35 AM Post subject: |
|
|
I didn't realise it got messed up... Here it is again  _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
Tsudeki Newbie
Joined: 09 Apr 2004 Posts: 10
|
Posted: May 13th, 2004 03:40 PM Post subject: |
|
|
^_^ Thanks As usual your reply is fast lol...I'll put it to good use  |
|
| Back to top |
|
RoofRabbit Regular

Joined: 06 Jul 2005 Posts: 95 Location: Lenoir, NC USA
|
Posted: Jul 6th, 2005 11:20 PM Post subject: |
|
|
I prefer using custom data files rather than the registery myself.
Reasons:
1) I don't like dealing with a 38 meg file (my registery file size) when I'm only storing a few bytes.
2) If the data file contains parms needed for a program's execution, it's easy to copy the data file along with the program to another computer. Copying the registery isn't possible.
3) You can store any data type in your own files and in any mixture of data types in any order you wish.
4) Severe errors in writing a data file only corrupts the data file, where the same problem in the registery could crash the entire system.
Personally I think the registery is used FAR too often just to store a few simple vars. _________________ Website - [link] |
|
| Back to top |
|
|