Kbase P141158: 4GL/ABL: Error (5442) passing a LONGCHAR parameter to a LARGE EDITOR widget INSERT-STRING( ) method.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/02/2009 |
|
Status: Unverified
SYMPTOM(s):
4GL/ABL: Error (5442) passing a LONGCHAR parameter to a LARGE EDITOR widget INSERT-STRING( ) method.
Invalid datatype for argument to method ''<name>. Expecting ''<name> (5442)
Invalid datatype for argument to method ''INSERT-STRING'. Expecting 'character'' (5442)
The error is generated when executing code similar to the following:
DEFINE VARIABLE lcVar AS LONGCHAR NO-UNDO.
ASSIGN
lcVar = FILL ('a', 31000)
lcVar = lcVar + fill ('b', 31000).
EDITOR-1:INSERT-STRING (lcVar).
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.1x
CAUSE:
The input parameter of the INSERT-STRING( ) method must be a CHARACTER data type string expression. No other data types are allowed.
FIX:
Use an temporary CHARACHTER variable to load the contents of the LONGCHAR variable into the LARGE EDITOR widget a chunk (less than 32K) at a time. For example the following code loads the 62000 character long LONGCHAR data into the LARGE EDITOR widget 31000 character at a time:
DEFINE VARIABLE lcVar AS LONGCHAR NO-UNDO.
DEFINE VARIABLE cVar AS CHARACTER NO-UNDO.
ASSIGN
lcVar = FILL ('a', 31000)
lcVar = lcVar + fill ('b', 31000).
cVar = SUBSTRING(lcVar,1,31000).
EDITOR-1:INSERT-STRING (cVar).
cVar = SUBSTRING(lcVar,3100,62000).
EDITOR-1:INSERT-STRING (cVar).