Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Counf keys in ini section (http://forums.winamp.com/showthread.php?t=306322)

bukox 13th May 2009 10:47

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...

Afrow UK 13th May 2009 11:16

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

Stu

bukox 13th May 2009 11:24

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

Comperio 13th May 2009 16:26

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:
code:
!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}


bukox 13th May 2009 18:56

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...


All times are GMT. The time now is 17:44.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.