Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Custom page fields count (http://forums.winamp.com/showthread.php?t=251954)

y2kanily2k 26th July 2006 05:14

Custom page fields count
 
How to get the number of fields in a custom page.

CancerFace 26th July 2006 08:54

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

Afrow UK 26th July 2006 09:13

As long as the INI file is srt up correctly, just read Settings > NumFields!

-Stu

CancerFace 26th July 2006 10:17

I thought that InstallOptionsEx doesn't need to have the NumFields parameter in the INI file ...
CF

Comperio 26th July 2006 13:39

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

CancerFace 26th July 2006 14:14

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


All times are GMT. The time now is 05:40.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.