$text
Return the text of a message or help text.
$text(
IDString)
Example: vLabelText=$text(%%$fieldname)
Parameters
Parameter | Data Type | Description |
---|---|---|
IDString | String | Message name. |
Return Values
- Text associated with the message IDString.
- Text of message 8006, if the message identified by IDString does not exist or cannot be found.
Use
Allowed in all component types.
Description
$text is commonly used to access messages and help texts in runtime libraries.
$text uses the current language and library (in $language and $variation) to retrieve the text. If a message or help text cannot be found with the current $language and $variation, Uniface also looks for combinations with language USA and library USYS.
You can use the function $textexist to determine if a message or help text exists before requesting the text with $text.
If $text is used in a component that is run on a server, it is the developer's or deployment manager's responsibility to ensure that the referenced texts are available in a UAR file.
Displaying Help Text
The following example displays the string in the message HELPTEXT:
trigger help help/noborder $text(HELPTEXT),3,4,7,23 end; help
If you use a help message naming convention of
Fieldname _HLP
, you can use the following ProcScript statement
in the help trigger of the modeled field:
trigger help ; of field help $text("%%$fieldname%%%_HLP") end; help
(Of course, you should not use this ProcScript in the entity-level help trigger, since $fieldname is only valid when used in field-level triggers.)
If you are using a variable that holds IDString, the value in the variable must be substituted in a string. You cannot use the variable name directly. For example:
vString = "9004" help $text("%%vString")