Archived

This topic is now archived and is closed to further replies.

Quick serch algorithms

This topic is 6363 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everybody. I had just a simple question. Ok, i had the following problem. I had some ini-files in which many important information about my applikation are saved. Now when i read from this file and i would only a definitely string like "InstallPath = c:\programs\". Exists there any search algorithms with which i can find such a string quickly, because when the files are very big the perfomance will suffer. I know there exists a binary-search-algorithms, but this one is not good for this case. I hope someone can help me. Thank you for you help! Peter G.

Share this post


Link to post
Share on other sites
Well the easiest solution is stick to the INI-Standards, don''t use any weird sutom file stuff and use the GetPrivateProfileString and WritePrivateProfileString to handle the ini file. If that''s two slow (I''ve tested it on files up to a couple hundred kb) e-mail me back and I''ll post an "InStr" procedure, it works like vb''s instr but it''s written in asm. You could eaily stick it into in-line assembly.
See ya,
Ben

P.S. actually e-mail me if you want that procedure. Otherwise I may forget to check back on the post. :-)

Share this post


Link to post
Share on other sites
Hi ben

thank you for the tip with the INI-File standard-functions. I decide now to write and read the setting information about my application from the registry. I think thats easier and I do not need an Ini-File.
Nevertheless thank you for your help

bye

P. Gmeiner

Share this post


Link to post
Share on other sites
quote:
when the files are very big


I hate my registry being filled with A LOT of useless junk. I don''t care if the application is helpful to me or not, I just hate people putting all of their junk in my registry, and almost 90% of those people do not know how to manipulate the registry properly, and where to place their "junk". I would suggest that you stick to files, you (or the user) can always delete the file when your application is uninstalled, but not many people can clean up their registry (and as you said, it would be a VERY BIG pile of information). I hope I don''t come across your program at all.

-------------------------

That's just my 200 bucks!

..-=gLaDiAtOr=-..

Share this post


Link to post
Share on other sites

When you mean that the information which is saved in the registry is a useless junk then you are wrong. In the most cases the Information who was earlier saved in Ini-Files, now are in the registry. And I think this is the background idea of the registry, to reduce the Ini-Files. And these are in my eyes only some important setting data like InstallPath or the Language. A good software should remove when it were uninstalled the registry-entries automatically. I think for the User the registry is completely uninteresting and that should be so. I also not say that I will save big pile of information to the registry. My first question was only if there exists a method to get definitely information from a file very quickly and nothing more!!

P.G.

Share this post


Link to post
Share on other sites