%To_String function


Old name
%HI_To_String
Function
The function converts the specified value to a text according to the given Status text, System text and Transformation palette (see the topic Value representation methods in D2000 system) and translates the final text automatically by Dictionary according to the defined language.

The function may be also used in server script (object of Event type).

Declaration
TEXT
%To_String(
          in expression
   [, HBJ in refToStatusText
   [, INT in transPalIdx
   [, INT in lngIdx]]]
 )
Parameters
expressionExpression, the result value of which is to be converted to a text.
refToStatusTextOptional parameter. Reference to object of Status text type.
transPalIdxOptional parameter. Index of Transformation palette.
lngIdxOptional parameter. Language index in Dictionary.
Return value
Return value is Text type.
Note

The parameter refToStatusText must be the reference to an existing object of Status text type or the value of 0. Use the value of 0 if you need to define a transformation palette index and do not want to use a status text.

The parameter transPalIdx is valid within the range of 1..32. If its value is out of range, the parameter will not be used.

Parameter lngIdx is valid within the range of the defined languages in dictionary. If its value is out of this range, the value will be a default language.

The second and third parameters must be valid values. If these conditions are not met, the function will returns invalid value.

Example
TEXT _text
 INT  _value
 
 _value := 1
 ; conversion according to configuration of status text SText and Transformation palette index
 _text := %To_String(_value, SText\HBJ, 1)
 
 ; conversion according to Transformation palette index
 _text := %To_String(_value, 0, 1)
 
 ; conversion according to configuration of status text SText
 _text := %To_String(_value, StavovyText\HBJ)
 
 ; conversion according to a language ID
 _text := %To_String(_value,0, 0, 2)
Napíšte komentár