p$TDV:Util:ParText
p$TDV:Util:ParText
Determine parametric text, i.e. replace all parameters in a text with values A parametric text is a normal text that also contains variables for parameter values. Parameters are surrounded by the ’@’ symbol, analogously to the text generation function.
Example: | ’The price for @Number@ pieces is @Price@ Euro’ |
Additionally, every parameter can be annotated with a formatting. In standard case the format routine is adopted from the parameter table. Special feature: For numeric parameters the number of digits denoted in the PT is taken into account to create a right-aligned output.
However, it is also possible to use special formats: When using Characters, it is possible to tag partial texts. The syntax corresponds to the partial texts in ePOS:
text(<startpos>:<endpos>)
, or | text (<startpos>:) |
If the current text in that case is shorter than denoted by the partial text, the remaining part is filled with spaces.
Numeric parameters can be formatted by the variable symbol ’#’, analogously to the formatting command of the parameter table. A period or a comma can be used as a decimal separator.
number(#####,##)
, or | number(###.#####) |
, or | number(###) |
Number output is conducted in a right-aligned manner.
Please note:
In order to guarantee correct parameter definition all parameters used in the format text have to be completely global!
Syntax: | Text = p$TDV:Util:ParText( FormatText ) | ||
| Argument | Type | Meaning |
| FormatText | String | Formatting command for the generated text |
Result: | String | resulting text | |
Example: | Assume the following: Article.Name = 'Pump' | ||
| Then Text = p$TDV:Util:ParText( 'Component @Article.Name@ No. @Article.Ident(3:)@ (@Article.Price(###,##)@ €)' ) | ||
| results in Text = 'Component Pump No. 4711 (256,67 €)' | ||