Archive: Counf keys in ini section


Counf keys in ini section
Hello.
How can I count keys in section or check if any key exists in section in ini file? I can use EnumINI plugin but that is very uncomfortable way.

bye...


You could use this function:
http://nsis.sourceforge.net/Get_all_...on_of_INI_file

Stu


And there's no easier way? Do I have to define custom function to handle this?


There are no built-in functions for this if that's what you're asking.

For counting, Afrow's is probably the best you're going to get (aside from writing your own function/macro).

For checking the existence of a key, you could use:

!include logiclib.nsh
...
ReadIniStr $0 "C:\myfile.ini" "Section" "Key"
${if} ${Errors}
MessageBoz MB_OK "key does not exist"
${Else}
MessageBox MB_OK "Key was found"
${endIf}

Yes, but I want to know if any key exists in section (count of keys is gross than 0) becouse I don't know name of keys and I don't need it.

bye...