Archive: Problem


Problem
Hi,

I have a subsection with 6 section in it. I want that when i click on section 15 that 14 gets unselected and the other way around. Also i want thos for seaction 3,5 and 4,6. I treid some code but it doesn't work can someone please help?

The code is for Section 15,14 and 3,5 can someone tell me what is wrong?

Function .onInit
Push $0

StrCpy $R9 ${section_15} ; Gotta remember which section we are at now...
SectionGetFlags ${section_15} $0
IntOp $0 $0 | ${SF_SELECTED}
SectionSetFlags ${section_15} $0

SectionGetFlags ${section_14} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${section_14} $0

StrCpy $R7 ${section_3} ; Gotta remember which section we are at now...
SectionGetFlags ${section_3} $0
IntOp $0 $0 | ${SF_SELECTED}
SectionSetFlags ${section_3} $0

SectionGetFlags ${section_5} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${section_5} $0

Pop $0
FunctionEnd

Function .onSelChange
Push $0

SectionGetFlags ${section_13} $0
IntOp $0 $0 & ${SF_SELECTED}
StrCmp $0 0 skip
SectionSetFlags ${section_14} 0
SectionSetFlags ${section_3} 0
SectionSetFlags ${section_4} 0
SectionSetFlags ${section_15} 0
SectionSetFlags ${section_5} 0
SectionSetFlags ${section_6} 0
skip:

StrCmp $R9 ${section_15} check_section_15

SectionGetFlags ${section_15} $0
IntOp $0 $0 & ${SF_SELECTED}
IntCmp $0 ${SF_SELECTED} 0 done done
StrCpy $R9 ${section_15}
SectionGetFlags ${section_14} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${section_14} $0

Goto next

check_section_15:

SectionGetFlags ${section_14} $0
IntOp $0 $0 & ${SF_SELECTED}
IntCmp $0 ${SF_SELECTED} 0 done done
StrCpy $R9 ${section_14}
SectionGetFlags ${section_15} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${section_15} $0

Goto done

next:

StrCmp $R7 ${section_3} check_section_3

SectionGetFlags ${section_3} $0
IntOp $0 $0 & ${SF_SELECTED}
IntCmp $0 ${SF_SELECTED} 0 next
StrCpy $R7 ${section_3}
SectionGetFlags ${section_5} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${section_5} $0

check_section_3:

SectionGetFlags ${section_5} $0
IntOp $0 $0 & ${SF_SELECTED}
IntCmp $0 ${SF_SELECTED} 0 done done
StrCpy $R7 ${section_5}
SectionGetFlags ${section_3} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${section_3} $0

done:
Pop $0
FunctionEnd


Try using the macros in Sections.nsh


I think the problem is that you're skipping the 3 and 4 tests by jumping to done. You should have a done label for 14 and 15 check, and another one for the 3 and 4 check. The simplest way would probably be putting those two checks in seperate functions and calling both of those from .onSelChange.

If that's not it, attach a complete example so it'd be possible to see exactly what's wrong.

Please attach large scripts next time.


Thanx both, i tried it first with what kichik said, because it sounds easier and it works great. I will also try it with the macros only need to find how that works. Also sorry nexy time i will attach large codes.