Old 13th May 2009, 10:47   #1
bukox
Junior Member
 
Join Date: Jun 2007
Posts: 10
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...
bukox is offline   Reply With Quote
Old 13th May 2009, 11:16   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You could use this function:
http://nsis.sourceforge.net/Get_all_...on_of_INI_file

Stu
Afrow UK is offline   Reply With Quote
Old 13th May 2009, 11:24   #3
bukox
Junior Member
 
Join Date: Jun 2007
Posts: 10
And there's no easier way? Do I have to define custom function to handle this?
bukox is offline   Reply With Quote
Old 13th May 2009, 16:26   #4
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
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}

Comperio is offline   Reply With Quote
Old 13th May 2009, 18:56   #5
bukox
Junior Member
 
Join Date: Jun 2007
Posts: 10
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...
bukox is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump