Skip to content
⌘ NSIS Forum Archive

How works "flags" in SectionSetFlags?

4 posts

Guest#

How works "flags" in SectionSetFlags?

Hi, I explain my problem before: in components page I have one group with three checkboxes A, B, C... and another checkbox D outside the group... initially none of them are checked, and the first checkbox A is selectable and the others B and C are read only and so disabled. I want to enable checkbox B and C only when checkbox A is selected so I written this function (1 is the checkbox A, 2 B, and 3 C):

Var flags

Function .selTest
SectionGetFlags 1 $flags
StrCmp $flags 0 equal diff

diff:
SectionSetFlags 2 ?!?!??!?
SectionSetFlags 3 ??!?!??!
goto end

equal:
SectionSetFlags 2 ${SF_RO}
SectionSetFlags 3 ${SF_RO}
end:
FunctionEnd

Function .onSelChange
Call .selTest
FunctionEnd

My problem is that I don't know what write in the place where is !??!?!?! I have read Section.nsh and documentation, but I don't have understand how flags works... the code...
Is a 32-bit integer but I have to manage? The flags is 1 or 0? How I can "jump" a flag if I don't want to set? I try to write "0" and the checkbox seems to return selectable but when I click it don't work, remain not-checked.

Sorry for my english, I'm italian.
Guest#
Re: How works "flags" in SectionSetFlags?

Originally posted by kudraw
[...]Is a 32-bit integer but how I can manage? [...]
Sorry again for bad english.
kichik#
Use the SetSectionFlag and ClearSectionFlag macros from Include\Sections.nsh. This way you won't have to deal with combining the flags on your own.