A string is storing characters in program code.
A string is managed by TCE as a Unicode string. Therefore, each character of a string is stored internally in two bytes. Thus, up to 65535 different characters can be managed.
Strings entered in the program code must be framed by a " or a '. It is important that the same border character is used at the beginning as at the end.
"Plasma" -> Plasma
'Plasma' -> Plasma
If you want to use the " in the string, this can be achieved by doubling the character in the string.
"""Plasma""" -> "Plasma"
It is also possible to use the Function Chr to form a string.
Chr(34) & "Plasma" & Chr(34) -> "Plasma"
By using pipes, contents of variables or return values of functions can be included in a string:
"The device is a |TV_Type| TV"
"The device is a |Chr(13) & Chr(10)| TV"
On run time, the variables specified in pipes are replaced by their value:
The device is a Plasma TV
The
device is a
TV
If you want to wrap a string in a function for better readability, the last character of a line can be the character _ after a space:
SQL := "SELECT Field1 FROM Table1 _
WHERE Field2=10"
The spaces before the WHERE in the example above are used in the string. The character _ and the break is ignored in the string.
SELECT Field1 FROM Table1 WHERE Field2=10
Strings can also be connected to the &= operator.
S := "Plasma"
S &= " TV"
-> "Plasma TV"
A multilingual string can be created by a multilingual string constant or by the ML function.
S := ML("EN", "DE", "Fernseher", "EN", "TV")