SUBS function

Syntax

SUBS (array1, array2)
CALL -SUBS (return.array, array1, array2)
CALL !SUBS (return.array, array1, array2)

Description

Use the SUBS function to create a dynamic array of the element-by-element subtraction of two dynamic arrays.

Each element of array2 is subtracted from the corresponding element of array1 with the result being 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 missing element is evaluated as 0. If either of a corresponding pair of elements is the null value, null is returned for that element.

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

Example

A=2:@VM:4:@VM:6:@SM:18
B=1:@VM:2:@VM:3:@VM:9
PRINT SUBS(A,B)

This is the program output:

1V2V3S18V-9