Kbase P138433: DYNAMIC-NEW does not compile when used in class file.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  3/2/2009 |
|
Status: Unverified
SYMPTOM(s):
DYNAMIC-NEW does not compile when used in class file.
The following example causes errors 247 and 250 because the class-name expression VarClsName cannot be something other than a simple field:
/* start class */
CLSS example :
CONSTRUCTOR PUBLIC example(INPUT myRec AS RE) :
DEF VAR myCust AS CLASS Customer NO-UNDO.
DEF VAR VarClsName AS CHAR INIT "Customer" NO-UNDO.
/* Does not compile */
myCust = DYNAMIC-NEW VarClsName(INPUT myRec).
IF VALID-OBJECT(myCust)
THEN DO :
/* DISP myCust:getRef().*/
DELETE OBJECT myCust.
END.
END CONSTRUCTOR.
END CLASS.
/* end */
** Unable to understand after -- "<string>". (247)
** Cannot process comparison in expression. (250)
FACT(s) (Environment):
UNIX
Windows
OpenEdge 10.1C
CAUSE:
Bug# OE00167875
FIX:
Upgrade to 10.2A or as a workaround use string(VarClsName), substr(VarClsName,1) or "classname" as a constant:
myCust = DYNAMIC-NEW STRING(VarClsName) (INPUT myRec).