CodeGen Documentation
CodeGen Documentation

Parameter Loops

 

A parameter loop is a template file construct which allows you to iterate through the collection of parameters of a method that CodeGen has information about. These parameter definitions come from a method definition in a Synergy parameter Catalog.

 

Parameter loops are delimited by a matching pair of <PARAMETER_LOOP> and </PARAMETER_LOOP> tags, which surround the template code to be inserted for each parameter. The code between the opening and closing tags of an parameter loop is repeated for each parameter in the interface catalog being processed. This code may contain other generic and structure tokens, and may also contain special parameter loop tokens, which are discussed later. Loop utility tokens can also be used in parameter loops.

 

There are two types of parameter loop, called multi-line parameter loops, and in-line parameter loops.

 

Multi-Line Parameter Loops

Multi-line parameter loops occur when the opening and closing parameter loop tags appear on separate lines in a template file, and delimit one or more entire lines of template code, like this:

[code]

<PARAMETER_LOOP>
code
</PARAMETER_LOOP>

[code]

Multi-line parameter loops generate one or more lines of output code for each parameter that is processed.

In-Line Parameter Loops

In-line parameter loops exist when the opening and closing parameter loop tags appear on the same line in a template file, and delimit part of a line of template code, like this:

[code] <PARAMETER_LOOP> code </PARAMETER_LOOP> [code]

In-line parameter loops generate code into the current output line.

Processing Structure Parameters

When processing STRUCTURE parameters ONLY (check by using the parameter loop expression <IF STRUCTURE>) you may also use the following:

Structure expansion tokens

Structure expression tokens

Field loops and field loop expansion and expression tokens.

An error will be generated if you attempt to use any of these when processing other types of parameter.

 

 

 


Copyright © 2021  Synergex International, Inc.