Sashka
30th March 2005 07:52 UTC
problem with "section index"
I have a section definition in the following fashion: 'Section /o "MySection" setSmth'. The section is within a SectionGroup (just in case it could affect my problem). When I try to do 'SectionGetFlags ${setSmth} $0', ${setSmth} is undefined (even compiler complaints about the fact). However, when I try to do 'SectionGetFlags 17 $0' (with '17' being the section index that I counted by hand), everything works. What's wrong?
glory_man
30th March 2005 10:59 UTC
I tried to test it and all works.
Where are you use SectionGetFlags (inside section, function or ...)?
Afrow UK
30th March 2005 12:25 UTC
${setSmth} will be defined as the compiler reaches that line. So naturally, if you try and use the ${setSmth} define before the Section call then it will not have been defined yet.
-Stu
Sashka
30th March 2005 13:56 UTC
Yes, that's true, my Section definition is after I refer to the variable into which its index is put, i.e. ${setSmth}. But NSIS installer is not sequential really, so I thought it does not matter where you define section and where you refer to its index. I actually tried to use this undefined section index within .onSelChange function. Anyway, I fixed everything by simply moving .onSelChange function definition at the end of the script
kichik
31st March 2005 18:22 UTC
The preprocessor is sequential and a define is a preprocessor "variable".