frodelan
25th March 2008 15:43 UTC
Hide section from a function
Hi, I have a section
Section "PHP" SectionPHP
...
SectionEnd
I have this code in .onInit: SectionSetText ${SectionPHP} "" And the section is hided.
If I put SectionSetText inside a Function which is placed in a .nsh file, and call that function from .onInit - the section is displayed anyway.
Why?
demiller9
25th March 2008 16:16 UTC
It might be that you hardcoded the sectionId and the include function comes before the section. The constant 'SectionPHP' gets defined when the Section is compiled; you cannot reference the defined name ${SectionPHP} before that.
If you don't want to put the function below the sections (ie, have the nsh included after the sections), you can pass the ${SectionPHP} value to the function when you call it.