User Tools

Site Tools


named_sections.htm
Navigation:  Templates > Template Language Reference > Complete Alpha Listing >====== Named #SECTIONS ====== Previous pageReturn to chapter overviewNext page

A new parameter has been added to the #SECTION statement.

Example:

 

#SECTION('First Section')

#ENDSECTION

#SECTION('Another Section')

#ENDSECTION

This parameter can then be referenced by the SECTION attribute of the #APPEND statement as follows:

 

#APPEND('FileName'),SECTION('Another Section')

#APPEND('FileName'),SECTION('First Section')

The first #APPEND statement with the SECTION attribute uses the last defined section in source order. The next #APPEND statement is used for the previous section, etc

 

A named #SECTION can be used with the #APPEND statement only once.

 

If the SECTION attribute of the #APPEND statement has a parameter defined, for example:

#APPEND('somefile'),SECTION('somesection')

the template source generator will append the #SECTION defined with the name 'somesection' and then removes it from the list of sections.

 

If the SECTION attribute has no parameter

#APPEND('somefile'),SECTION

the generator uses the most recently declared #SECTION not removed yet from the top of sections stack and then pops it (but does not destroy).

 

In summary, to avoid any logic problems, all #APPEND statements should not mix usage of named and unnamed sections.

named_sections.htm.txt · Last modified: 2021/04/15 15:57 (external edit)