CTEXT

The CTEXT specifies the character set of the output of the function.

From that point onward, the data is treated as if it were in that character set. If the data is not in the specified character set, you get the wrong answer.

The character set is required to be specified in this function. If you choose not to specify a character set, you should use the original version of the TEXT function.

Syntax:

CTEXT ( single-object-expression , "character-set-of-object-content")

Meaning:
CTEXT ( object_to_convert , object_character_set )
Returns:
A single text item

The first argument, object_to_convert, represents the object that is converted to a text item, excluding the initiator and terminator of the input object.

The second argument, object_character_set, represents the character set of the resulting object.

Example

In this example, the group Record has an initiator of the pound sign (#), a terminator of the at sign (@), and a delimiter of a comma (,), and uses the following data:

#1339X10A,491.38,Green,42x54@

  • CTEXT ( Record:card, "ASCII")

    Returns: 1339X10A,491.38,Green,42x54

The initiator and terminator are not included because only the content of the object is converted to text.