User Function in a For Each

lee_shelton

New Member
Am I missing something:
(Progress 8.2c CHUI SCO Unix)
(Table Customer has Name, City, State, etc. )

when I go:
FOR EACH CUSTOMER WHERE soundex(CITY) = soundex("OTTAWA"):

display CUSTOMER.
END.

I get no results.
but....
FOR EACH CUSTOMER:

IF soundex(CITY) = soundex("OTTAWA") THEN
display CUSTOMER.

END.

_DOES_ return records.

What be wrong ?
 

Chris Kelleher

Administrator
Staff member
Hi Lee-

I've run into this problem myself... and it behavior you are seeing is a bit confusing, but when a Progress 4GL predicate (such as a WHERE clause) contains a user–defined function, Progress evaluates the function once—when it opens the query or enters the FOR EACH block. The best solution would be the if...then code.

-Chris

------------------
Chris Schreiber
ProgressTalk.com Manager
chris@fast4gl.com
 
Top