Archive: ReadINIStr Finding a Section name from an entry name?


ReadINIStr Finding a Section name from an entry name?
I've got an INI file that looks like this:


[DevCppLang]
Name=Dev-C++ Language
Description=The language files for the wxDev-C++ IDE.
RemoteFilename=Language.DevPak
LocalFilename=Language.DevPak
Group=IDE
InstallPath=
Version=7.3.1.1
Size=315483
Date=2011-01-19 19:02
Execute=1


I can use ReadINIStr to find the value of the version for section [DevCppLang], but what I'd like to do is to find the version based on the LocalFilename field. For example,I'd like to do something like:

FindINIStr $0 $INIfilename 'LocalFileName=Language.DevPak' 'Version'

which will return 7.3.1.1 to $0.

Does something like this exist? Or, can someone suggest a solution?

Thanks.
-Tony


I threw this together and it works pretty well ^_^

PasteBin Post


Originally posted by Zinthose
I threw this together and it works pretty well ^_^

PasteBin Post
That's a keeper!

Thanks for the help.

-Tony

You're most welcome. :D

The only issue with it is were I put "## WARNING ASSUMTIONS MADE HERE"
Hopefully you won't run it against any INI files that have a lot of long section names. If you do you will have to expand the buffer size within the function. See the GetPrivateProfileSectionNames API function's reference for details.