SectionGetText with loop "for"
Hi everybody,
I have a problem with the function SectionGetText and use in a for loop:
Here is a quick excerpt from my code:
I have several of the type section:
Sectiongroup "One"
Section "aaa" SEC01
....
SectionEnd
Section "bbb" SEC03
....
SectionEnd
Section "xxx" SEC02
....
SectionEnd
SectionGroupEnd
Section "ccc" SEC03
....
SectionEnd
Function .onInit
...
SectionGetText ${SEC01} $1; Retrieve the name of the section and stores it in $ 1
IfFileExists "C:\$1" 0 +2
!insertmacro UnselectSection ${SEC01}
SectionGetText ${SEC02} $1 ; Retrieve the name of the section and stores it in $ 1
IfFileExists "C:\$1" 0 +2
!insertmacro UnselectSection ${SEC02}
...
FunctionEnd
I wish to change the last part of the code in Function .onInit by this :
${For} $R1 1 4
StrCpy $0 "SEC0$R1" ; Create the ref section in variable $0 example SEC01 For $R1=1
SectionGetText $0 $1 ; Stores the name of the section in $1
IfFileExists "C:\$1" 0 +3
!insertmacro UnselectSection $0
${Next}
The problem is that : SectionGetText $0 $1 always returns the same name.
against $0 change corectly.
Note : the sections are not arranged in chronological order and some have no reference.
I just want to access of the section identified by "SEC01"
I thank in advance those who will help me to solve a problem.