12.1T02
New functions for dynamic invention and derivation of function values
With the new "Mapping Register" and "Text Map Components" functions, the values of functions can be dynamically invented and applied to texts and components of texts.
The first of the new functions supplements the existing technology of manually maintained function tables with from and to values under "Setup". In contrast to this function, the values come ad hoc, e.g. from a list that is executed before the actual list is calculated. In addition, a second new function makes it much easier to replace components of a text using a function.
Mapping Register(<Mapping list>{;<Mapping separator>{;<From-To-Separator>{;<Mapping name>}}})
Creates a mapping with from and to values ad hoc
Parameters
<Mapping list> (Text): List of from and to values
Optional - <Zuordnungs-Trenner> (String): Separator between the composite values in the assignment list
Optional - <Von-Nach-Trenner> (String): Separator between the from and to values in the function (mapping)
Optional - <Funktionsname> (Texts): Name of the new function (mapping)
Return value
Text: Function name (if not already specified, an ID is generated)
Example
Wanted: Create a mapping with the codes (as From value) and the names (as To value) of item properties
Mapping Register("1:Colourant
Result:
"ArticleSupplementAbbreviationByName"
Text Map Components(<Text>;<Separator>;<Mapping name>{;<Reversal>{;<As of-Component>{;<To-Component>{;<Results separator>}}}})
Returns the from value of a mapping from the to value (or vice versa) in a composite text
Parameters
<Text> (Text): Given text
<Separator> (String): Separator between the composite values
<Mapping name> (Text): Name of the mapping
Optional - <Umkehrung> (Truth value): True = Replace To value with From value
Optional - <Ab-Komponente> (number): Position of the composite text from which the readout starts
Optional - <To-Component> (number): Position of the composite text up to which it is read out
Optional - <Ergebnis-Trennzeichen> (String): Separator between the read values
Example
Wanted: the names of the ingredients for the codes from a given text
Text Map Components("1,2,5"; ","; Mapping Register("1:Colourants;2:Preservatives; ...;5:Sulphur;...";";";":"))
Result: "Colouring, preservatives, sulphur"