The user interface component Label can be assigned a dynamic text instead of a static text. Dynamic text includes the two parts
•Language dependent translation
•Handling of variables.
Dynamic text is included in the user interface component Label and is assigned to the property “FormattedText”. (The property “Text” for the user interface components Label and Button only handles the translation part.)
The syntax of dynamic text has six commands; one format command (CR+LF) and five variables.
The meaning of each variable is dependent of which pre-defined user interface label is at hand, e.g. the label “TerminalIdLabel” uses one variable containing the terminal identification. The meanings of the different variables in the pre-defined labels are described together with a general label description in Appendix G .
Text and commands can be mixed together. In fact, the commands are separated by the “@” character. If it is not a command, is it treated as text and each text string is looked up in the file translation.xml (see Translation).
The commands are described in the table below.
Commands
@D1
Writes the variable D1 which is a date value formatted according to the property “FormattingInfo”. If this property is missing, a short date pattern (“d”) is used. The date depends on the label name. Note that “FormattingInfo” affects both @D and @T variables.
@E
Enter (Carriage Return + Line Feed/CR+LF).
@S
Writes the variable S which is a string value. The variable has a different meaning depending on the type of label.
@T1
Writes the variable T1 which is a time value formatted according to the property “FormattingInfo”. If this property is missing, a short time pattern (“t”) is used. The time depends on the label name. Note that “FormattingInfo” affects both @D and @T variables.
@V1
Writes the variable V1 which is a monetary value that is formatted according to regional notation for current language. The variable has a different meaning depending on the type of label.
Example:
A label with the name “StartTimeLabel” has the purchase start time accessible in variables “D1” and “T1”. The variables can then be used when forming the displayed text.
Giving the property: FormattedText = “Start time@: @D1 @T1”
will display the text: “Start time: 5/15/2009 2:15 PM” if English (United States) is the current language
If Swedish is the current language the text: “Starttid: 2009-05-15 14:15” will be displayed.
Parsing the string FormattedText = “Start time@: @D1 @T1” gives:
1.“Start time” is translation checked. If there is a translation for the current language the translation will be displayed. Otherwise “Start time” is displayed.
2.“: “ is translation checked.
3.D1 displays the variable which, is this case, includes start time (YYMMDD). The date format is language controlled.
4.“ “ is translation checked.
5.T1 displays the variable which, is this case, includes start time (HHMM). The time format is language controlled.
Date and Time variables have a lot of pre-defined formats for displaying dates and time. The pre-defined formats are language dependent. It is also possible to make custom formats as described below.