After some frustrating tests, my question now just fall on the statement that "Shall CAN-FIND return true if there are more than 1 qualified rows". My logical thinking tells me a yes but the 4GL behavior in 9.1D says a no.
Here is an example to tell the story better:
Say table a has a two fields a_name & a_code. And that table has two rows:
a_name a_code
--------------------
a1 1
a2 1
And what will that 4GL segment show?
IF CAN-FIND(a WHERE a_code=1 NO-LOCK) THEN
MESSAGE "1 is in table" VIEW-AS ALERT-BOX.
ELSE
MESSAGE "1 is NOT in table" VIEW-AS ALERT-BOX.
Surprise to me that it shows "1 is NOT in table". But if I can the 1st line into
IF CAN-FIND(FIRST a WHERE a_code=1 NO-LOCK) THEN
it shows "1 is in table" now.
Your comments are welcome.
Sincerely,
Lei
Here is an example to tell the story better:
Say table a has a two fields a_name & a_code. And that table has two rows:
a_name a_code
--------------------
a1 1
a2 1
And what will that 4GL segment show?
IF CAN-FIND(a WHERE a_code=1 NO-LOCK) THEN
MESSAGE "1 is in table" VIEW-AS ALERT-BOX.
ELSE
MESSAGE "1 is NOT in table" VIEW-AS ALERT-BOX.
Surprise to me that it shows "1 is NOT in table". But if I can the 1st line into
IF CAN-FIND(FIRST a WHERE a_code=1 NO-LOCK) THEN
it shows "1 is in table" now.
Your comments are welcome.
Sincerely,
Lei