MATCHES Operator

andyman

New Member
To anyine who can lend assistance:

Here is my dilemma, I am attempting to use the MATCHES operator to find any and all customer names that match any portion of the character variable that the user enters. However, the comiler is interpreting my syntax around my variable to be a character value called "name". Here is my code to shed some light on the subject

DEFINE VARIABLE name AS CHARACTER FORMAT "X(30)" NO-UNDO.

DEFINE FRAME fr1
SKIP(1.25) "Please enter a customer name: " name SKIP(1.25)
WITH NO-LABELS ROW 5 CENTERED TITLE "Search for Account Information By Name".

REPEAT:

UPDATE name WITH FRAME fr1.

FOR EACH custaddr WHERE custaddr.name MATCHES "*name*" NO-LOCK:

DISPLAY custaddr.cust-num
custaddr.name.

END.
END.


Thanks in advance for your advice.
 

ycy

New Member
Hi u can use this

for each table-name where table-field mathces ("*" + variable-name + "*"):
display fields.
end.

hopefully it should satisfy ur requirement.
 

andyman

New Member
Thank you very much

Your assistance is greatly appreciated. I think I tried every combination except for the one you recommended. I tried it and it worked like a charm. Thanks again.

Best Regards,

Andy
 
Top