SPLICE function

Syntax

SPLICE (array1, expression, array2)
CALL -SPLICE (return.array, array1, expression, array2)
CALL !SPLICE (return.array, array1, expression, array2)

Description

Use the SPLICE function to create a dynamic array of the element-by-element concatenation of two dynamic arrays, separating concatenated elements by the value of expression.

Each element of array1 is concatenated with expression and with the corresponding element of array2. The result is returned in the corresponding element of a new dynamic array. If an element of one dynamic array has no corresponding element in the other dynamic array, the element is returned properly concatenated with expression. If either element of a corresponding pair is the null value, null is returned for that element. If expression evaluates to the null value, null is returned for the entire dynamic array.

If you use the subroutine syntax, the resulting dynamic array is returned as return.array.

Example

A="A":@VM:"B":@SM:"C"
B="D":@SM:"E":@VM:"F"
C='-'
PRINT SPLICE(A,C,B)

This is the program output:

A-DS-EVB-FSC-