Kbase P122794: Errors 5627 and 573 with FOR EACH WHERE clause calling a OO4GL method
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  3/13/2007 |
|
Status: Unverified
SYMPTOM(s):
Errors 5627 and 573 with FOR EACH WHERE clause calling a OO4GL method
Calling a method from a FOR EACH statement within another method, in the same OO4GL Class results in compilation errors in OpenEdge Architect.
Undefined function or operator '<function>' referenced. (5627)
Wrong number of parameters for function. <number> supplied, <number> expected. (573)
** <program> Could not understand line <number>. (196)
An OO4GL class defined with the following format fails to compile with errors:
CLASS test final:
define temp-table tt no-undo
field test as character.
method private character GetRelId (a as character):
return("Hei" + (if a = "" then "" else " ") + a).
end method.
method private logical thisFails ():
for each tt where tt.test = GetRelId("John"):
display tt.
end.
return (false).
end method.
END CLASS.
The problem is the FOR EACH that uses the GetReld function in its WHERE clause.
CAUSE:
This is a known issue being investigated by Development
FIX:
Including such a method call in a FOR EACH WHERE clause is not the most efficient way to code since the function will have to be evaluated in each repetition of the FOR EACH loop. A better way to code this and also a way to work around the error would be to use:
method private logical thisFails ():
define variable x1 as character no-undo.
x1 = GetRelId("John").
for each tt where tt.test = x1:
display tt.
end.
return (false).
end method.