arrays.relational.expressions Definition/BASIC Program


Command arrays.relational.expressions Definition/BASIC Program
Applicable release versions: AP, R83
Category BASIC Program (486)
Description a brief discussion of referencing arrays in Pick/BASIC and the use of the special "wildcard" array searching character.

Individual elements of dimensioned and dynamic arrays are compared in relational expressions using the standard syntax. All elements of the array can be compared to a specified value by using an "*" (asterisk) to identify the element.

In multi-dimensioned arrays, one or more dimensions can be specified using the example. When the asterisk is used, the operators "<", ">", "=", "<=", ">=" and "#" return a true value if at least one element of the array satisfies the relation. The asterisk may be specified only in relational expressions and only in one array expression in a statement.
dim a(10)
if a(*) = "x" then ....

This compares all elements in the dimensioned array "a" to the value 
"x".  If any element equals "x", the "then" 
statement is performed.

if s<*> >= "10" then....

Checks that any element in the dynmaic array "s" is greater-than or 
equal to "10".

dim a(10,10)
if a(*,*)<*,*,*> = "x" then....

Checks every attribute, value, and subvalue in every string in the dimensioned 
array "a".
Related basic.dim