ORS function

Syntax

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

Description

Use the ORS function to create a dynamic array of the logical OR of corresponding elements of two dynamic arrays.

Each element of the new dynamic array is the logical OR of the corresponding elements of array1 and array2. If an element of one dynamic array has no corresponding element in the other dynamic array, a false is assumed for the missing element.

If both corresponding elements of array1 and array2 are the null value, null is returned for those elements. If one element is the null value and the other is 0 or an empty string, null is returned. If one element is the null value and the other is any value other than 0 or an empty string, a true is returned.

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

Example

A="A":@SM:0:@VM:4:@SM:1
B=0:@SM:1-1:@VM:2
PRINT ORS(A,B)

This is the program output:

1S0V1S1