diff --git a/Docs/src/sections.but b/Docs/src/sections.but index 46e11457..eb525ac4 100644 --- a/Docs/src/sections.but +++ b/Docs/src/sections.but @@ -24,7 +24,7 @@ Tells the installer that the current section needs an additional "size_kb" kilob \c [/o] [([!]|[-])section_name] [section_index_output] -Begins and opens a new section. If section_name is empty, omitted, or begins with a -, then it is a hidden section and the user will not have the option of disabling it. If the section name is 'Uninstall' or is prefixed with 'un.', then it is a an uninstaller section. If \e{section_index_output} is specified, the parameter will be !defined with the section index (that can be used for \R{sectionsettext}{SectionSetText} etc). If the section name begins with a !, the section will be displayed as bold. If the /o switch is specified, the section will be unselected by default. +Begins and opens a new section. If section_name is empty, omitted, or begins with a -, then it is a hidden section and the user will not have the option of disabling it. If the section name is 'Uninstall' or is prefixed with 'un.', then it is a an uninstaller section. If \e{section_index_output} is specified, the parameter will be \R{define}{!defined} with the section index (that can be used for \R{sectionsettext}{SectionSetText} etc). If the section name begins with a !, the section will be displayed as bold. If the /o switch is specified, the section will be unselected by default. \c Section "-hidden section" \c SectionEnd @@ -41,6 +41,32 @@ Begins and opens a new section. If section_name is empty, omitted, or begins wit \c Section "install something" SEC_IDX \c SectionEnd +To access the section index, curly brackets must be used and the code must be located below the section in the script. + +\c Section test1 sec1_id +\c SectionEnd +\c +\c Section test2 sec2_id +\c SectionEnd +\c +\c Function .onInit +\c SectionGetText ${sec2_id} $0 +\c MessageBox MB_OK "name of ${sec2_id}:$\n$0" # will correctly display 'name of 1: test2' +\c FunctionEnd + +\c Function .onInit +\c SectionGetText ${sec2_id} $0 +\c MessageBox MB_OK "name of ${sec2_id}:$\n$0" # will incorrectly display 'name of ${sec2_id}: test1' +\c # plus a warning stating: +\c # unknown variable/constant "{sec2_id}" detected, ignoring +\c FunctionEnd +\c +\c Section test1 sec1_id +\c SectionEnd +\c +\c Section test2 sec2_id +\c SectionEnd + \S2{ssectionend} SectionEnd This command closes the current open section.