/ Home / HowTo / GenTextEditor / TemplateTab / TemplateProcess


Section Processing

The lines of the Template are evaluated in order from top to bottom.

If no Section Item is in scope, the lines are output just as they appear in the template without attempting to process replacement names or values.

When a #SectionBegin directive is detected, the Section data from the Data XML file with the same name as the #SectionBegin directive is added to the Active Items list. These Section names are case sensitive.

The code between the #SectionBegin and #SectionEnd directives is generated once for each Section Item. The Items for the current Section are processed in the same order as they appear in the Data XML file.

If the Section data is not found, there are no section items to come into scope and the Section is of course not processed.

As each Item is processed, the replacement names are replaced with the available replacement values for the current Item from the Data XML file. Replacement Names are case sensitive.

If a replacement name is not found in the current Section Item, then the program looks back through the Parent Sections Active Items to see if there is a replacement of the same name in scope. It uses that replacement value if it is found, otherwise no replacement is performed.

When the #SectionEnd directive is detected and there are more Items in the current Section, the next available Item comes into scope and the template is processed again from the line after the current #SectionBegin directive.

If there are no more Items to process in the current Section, then the current section XML data is removed from the Active Item list and processing continues with the next line after the #SectionEnd directive.

If Processing

The syntax for the #IfBegin directive is: #IfBegin _ReplacementName_ Value. The directive "#IfBegin _DataType_ String" is true if the Replacement Name exists for the current Item and its content is "String".

Besides a specific value, the Value can also be "True", "False" or "NotNull". It is not case sensitive.

/ Home / HowTo / GenTextEditor / TemplateTab / TemplateProcess

Copyright © Lester J Clark and Contributors.
Licensed under the MIT License.