Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Syntax

TEMPLATE$(Template$, ReplaceMode%ReplaceMode%=0,1,2, [InpVar])

Arguments

  • Template$ is a string/document containing the textual skeleton of the document to be created, including parameters and format statements
  • ReplaceMode% is ReplaceMode% is an option how to replace the parameters in the template when "~" is used:
    • ReplaceMode% ReplaceMode% = 0: first remove "~ParName" and then overwrite the value of ParName over the remaining text starting on position of ~
    • ReplaceMode% ReplaceMode% = 1: first overwrite "~ParName" with spaces (the amount specified as Cell width in the Slots & Properties of the parameter) and then overwrite the value ofParName over the remaining text starting on position of ~
    • ReplaceMode% ReplaceMode% = 2: first remove "~ParName" and then insert the value of ParName
  • InpVar is an optional list of parameters present as labels in Template$ to be replaced by their values.

...

The writing mechanism with "~Name"

Mode%=0 

Assume LPP=33.37 with the cell width in de knowledge base defined as 6 

...

In this case, insufficient spaces are left in the template between ~LPP and [m].

Mode%=1 

To obtain a better result, you can used the ReplaceMode%ReplaceMode%=1:

TEMPLATE$("Length between PP: ~LPP [m]", 1, LPP) 

...

Note that 33.37 is followed by a space causing the left bracket to disappear... 

Mode%=2 

The final option is to use ReplaceMode%ReplaceMode%=2:

TEMPLATE$("Length between PP: ~LPP [m]", 2, LPP)

...

"Length between PP: 33.37 [m]"

Whether to use ReplaceMode%ReplaceMode%=0,1 or 2 depends on the purpose, the length of the parameter names, the definition of Cell width in the Slot & Properties and the format definition of the values in the template. All options have their advantages and disadvantages....

...