Old 26th July 2006, 05:14   #1
y2kanily2k
Junior Member
 
Join Date: Jul 2006
Location: ADF
Posts: 6
Send a message via ICQ to y2kanily2k
Custom page fields count

How to get the number of fields in a custom page.
y2kanily2k is offline   Reply With Quote
Old 26th July 2006, 08:54   #2
CancerFace
Senior Member
 
Join Date: Apr 2006
Posts: 289
Send a message via ICQ to CancerFace
Not sure if there is a better way, but this should do as long as every Field has a State:
code:
StrCpy $0 1
ClearErrors
Read:
ReadINIStr $1 "<ini_path>\<ini_file>" "Field $0" "State"
IfErrors Stop
IntOp $0 $0 + 1
Goto Read

Stop:
IntOp $0 $0 - 1
DetailPrint "Number of fields: $0"



CF
CancerFace is offline   Reply With Quote
Old 26th July 2006, 09:13   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
As long as the INI file is srt up correctly, just read Settings > NumFields!

-Stu
Afrow UK is offline   Reply With Quote
Old 26th July 2006, 10:17   #4
CancerFace
Senior Member
 
Join Date: Apr 2006
Posts: 289
Send a message via ICQ to CancerFace
I thought that InstallOptionsEx doesn't need to have the NumFields parameter in the INI file ...
CF
CancerFace is offline   Reply With Quote
Old 26th July 2006, 13:39   #5
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
The the original question did not refer specifically to InstallOptionsEX, so it should be assumed that we're talking about the normal InstallOptions. (InstallOptionsEX is actually it's own project now on SourceForce whereas InstallOptions is part of the NSIS install.)

But, it is a correct to say that in IOEX treats the NumFields setting as optional.

(On the plus side, if you use either the Exclipse InstallOptions plugin or HN NIS Edit program for creating your custom page, then you'll get the NumFields value set properly, so I think just reading the value is still a good way to go.)
Comperio is offline   Reply With Quote
Old 26th July 2006, 14:14   #6
CancerFace
Senior Member
 
Join Date: Apr 2006
Posts: 289
Send a message via ICQ to CancerFace
Fair enough.
I mainly use InstallOptionsEx so it makes sense, since I do not have a NumFields value, to read the number of fields in another way
CF
CancerFace 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