strLib.concatenate

The system function strLib.concatenate concatenates two strings.


strLib.concatenate syntax diagram

result

Numeric item that receives one of the following values (defined as type INT or the equivalent: type BIN with length 9 and no decimal places) returned by the function:

-1

Concatenated string is too long to fit in the target item and the string was truncated, as described later

0

Concatenated string fits in the target item

target

Target item

source

Source item or literal

When two strings are concatenated, the following occurs:

  1. Any trailing spaces or nulls are deleted from the target string.
  2. The source string is appended to the string produced by step 1.

  3. If the string produced by step 2 is longer than the target string item, it is truncated. If it is shorter than the target item, it is padded with blanks.

Example

  phrase = "and/  "; // CHAR(7)  
  or     = "or";
  result = 
    strLib.concatenate(phrase,or);
  if (result = 0)
    print phrase;  // phrase = "and/or "
  end

Related reference
String handling (system words)