Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Registry & File Input / Output

Post new topic   Reply to topic
Registery or .dat ?
View previous topic :: View next topic  
Author Message
wezel
Freshman


Joined: 09 Oct 2003
Posts: 30

PostPosted: Oct 13th, 2003 04:59 PM    Post subject: Registery or .dat ? Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Avis
Junior Poster


Joined: 07 Oct 2003
Posts: 510
Location: India

PostPosted: Oct 14th, 2003 01:11 AM    Post subject: Reply with quote

Hi!

I think the current .dat file will be best for your project. As if some user put a lot of reminders and you have used registry..then it would take time to load the registry again and again. This will make the computer slow becuase of big registry size. etc.

So an independent dat is okay!

Thanks!
_________________
Code Snippets, Tutorials, Utilities, Controls

Low cost Web Hosting
Hosting starts at as low as $4 per year!


Always follow posting guidelines
Put your VB code in [vb ] your code [ /vb] tags!
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Oct 14th, 2003 07:00 AM    Post subject: Reply with quote

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 Wink

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
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
wezel
Freshman


Joined: 09 Oct 2003
Posts: 30

PostPosted: Oct 14th, 2003 08:10 AM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Oct 14th, 2003 10:34 AM    Post subject: Reply with quote

Don't mention it :o Wink Biggrin
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Tsudeki
Newbie


Joined: 09 Apr 2004
Posts: 10

PostPosted: May 12th, 2004 07:21 PM    Post subject: Reply with quote

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. Smile
Back to top
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: May 13th, 2004 09:35 AM    Post subject: Reply with quote

I didn't realise it got messed up... Here it is again Wink
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Tsudeki
Newbie


Joined: 09 Apr 2004
Posts: 10

PostPosted: May 13th, 2004 03:40 PM    Post subject: Reply with quote

^_^ Thanks Smile As usual your reply is fast lol...I'll put it to good use Smile
Back to top
View user's profile Send private message
RoofRabbit
Regular


Joined: 06 Jul 2005
Posts: 95
Location: Lenoir, NC USA

PostPosted: Jul 6th, 2005 11:20 PM    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Registry & File Input / Output All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic