PROGRESS 4GL - does IF condition supports for dimensional array?
Solution 1:
This syntax is not valid : IF (anotarray OR barray) <> "" THEN ...
You have to cycle through all elements of your array. You can do it using a DO
statement and the EXTENT
function.
Also, you have to compare both variables to the empty string : IF anotarray <> "" OR barray[ix] <> "" THEN ...
This code should work :
DEFINE VARIABLE anotarray AS CHARACTER NO-UNDO.
DEFINE VARIABLE barray AS CHARACTER EXTENT 3 NO-UNDO.
DEFINE VARIABLE ix AS INTEGER NO-UNDO.
ASSIGN
barray[1] = "yes"
barray[2] = "no"
anotarray = ""
.
DO ix = 1 TO EXTENT(barray):
IF barray[ix] <> "" OR anotarray <> "" THEN DISP barray[ix].
END.
Solution 2:
You have two problems in this expression:
anotarray or barray
One is the error 361 that you have reported. That error is because you cannot check the entire array all at once. You need to check each element of the array.
The other issue is that OR compares logical values not character values.
So what you probably want to write is something more like:
if ( anotearry <> "" or barray[1] <> "" or barray[2] ) then display barray.