UC_CRLF

Use the UC_CRLF script function to insert a line break to denote the start of a new line.

Note: As of v24, CR (carriage return) and LF (line feed) is one character instead of previously two characters if you use it in the context of STR_LEN(). This change is based on the introduction of UTF-8. For details on how to derive CR and LF as single characters, see also HEX_2_STRING.

Syntax

UC_CRLF ()

Examples

  • The following script inserts a line break between two strings:

    :SET &NL# = UC_CRLF()
    :
    SET &STRING# = "AE &NL#System"

    As a result, the word system appears in a new line after the word AE:
    AE
    System

  • The following example explains two methods of displaying a Notification message using two lines of text. The result is the same although method 1 uses a script statement to append the newline script function, and method 2 uses a script variable to do so.

    Method 1:

    :PUT_ATT CALL_TEXT = "The workflow MM.DAY is blocked."
    :PUT_ATT_APPEND CALL_TEXT = UC_CRLF()
    :PUT_ATT_APPEND CALL_TEXT = "Escalation in 10 Minutes."

    Method 2:

    :SET &NL#=UC_CRLF()
    :
    PUT_ATT CALL_TEXT = "The workflow MM.DAY is blocked.&NL#Escalation in 10 Minutes."

  • The following example uses the UC_CRLF script function to insert a line break in the text that should be sent through an email.

    :SET &NL# = UC_CRLF()
    :
    SET &TEXT# = "The workflow MM.DAY is blocked.&NL#Escalation in 10 Minutes."
    :
    SET &RET# = SEND_MAIL("smith@automic.at",,"A task could not start!",&TEXT#)

  • The following example explains the difference in CRLF handling with UTF-8 as of v24 where you can use the new HEX_2_STRING script function to derive CR and LF as single characters:

    :SET &cr# = HEX_2_STRING("0D")
    :SET &lf# = HEX_2_STRING("0A")

    The following example can be used for pre-v24 versions. As of v24, it fails with a runtime error:

    :SET &crlf# = UC_CRLF()
    :SET &cr# = substr(&cr#,1,1)
    :SET &lf# = substr(&cr#,2,1)

    U00020305 Runtime error in object 'xxx', line '00003'. The start column for the sub-string statement ('002') is not within the string (length '0001').

See also: