>>>>>do case && journey's >>>>> >>>>> case empty(j_start) .and. empty(j_end) .and. empty(j_andor) >>>>> * do nothing >>>>> >>>>> case j_andor="OR" .and. !empty(j_start) >>>>> * but test that both times are not empty >>>>> if empty(j_end) && ignore the OR >>>>> expr=expr+".and."+ opjrny+j_start >>>>> else >>>>> expr=expr+".and. ("+opjrny+j_start+".or." ; >>>>> +opjrny+j_end+")" >>>>> endif >>>>> >>>>> case j_andor="OR" .and. empty(j_start) >>>>> * ignore the OR >>>>> if !empty(j_end) >>>>> expr=expr+".and."+opjrny+j_end >>>>> endif >>>>> >>>>> case empty(j_andor) >>>>> if !empty(j_start) >>>>> expr=expr+".and."+ opjrny+j_start >>>>> endif >>>>> if !empty(j_end) >>>>> expr=expr+".and."+ opjrny+j_end >>>>> endif >>>>>endcase >>>>>>>>>
WAIT WINDOW j_andor+[ !]before the DO CASE and see what value j_andor has. If it is not equal to [OR] no CASE of this do CASE will be satisfied.
do case && journey's case empty(j_start) .and. empty(j_end) .and. empty(j_andor) WAIT WINDOW [1] * do nothing case j_andor="OR" .and. !empty(j_start) WAIT WINDOW [2] * but test that both times are not empty if empty(j_end) && ignore the OR expr=expr+".and."+ opjrny+j_start else expr=expr+".and. ("+opjrny+j_start+".or." ; +opjrny+j_end+")" endif case j_andor="OR" .and. empty(j_start) WAIT WINDOW [3] * ignore the OR if !empty(j_end) expr=expr+".and."+opjrny+j_end endif case empty(j_andor) WAIT WINDOW [4] if !empty(j_start) expr=expr+".and."+ opjrny+j_start endif if !empty(j_end) expr=expr+".and."+ opjrny+j_end endif OTHERWISE WAIT WINDOW [5] endcaseO! BTW it is possible that some CASE to be satisfied, but not IF in it. Par example if j_ndor ==[OR] and EMPTY(j_start) BUT not empty(j_end)