If the CHARACTER and LONGCHAR datatype are mapped to System.String, do they still use the Progress limitation? I'm receiving a DITEM error when pasing System.String as an argument to a method that has LONGCHAR as parameter.
I'm trying to save DockManager's settings (in XML format) to a CLOB via LONGCHAR copy.
NOTE: Seems to be a problem only when passing System.String as an argument, but assigning it to the LONGCHAR is fine.
Can you turn off the DITEM checking?
Do you have a code sample of what is failing?
DEFINE VARIABLE encoder AS System.Text.UTF8Encoding NO-UNDO.
DEFINE VARIABLE ms AS System.IO.MemoryStream NO-UNDO.
encoder = NEW System.Text.UTF8Encoding().
ms = NEW System.IO.MemoryStream(). ultraDockManager:SaveAsXml(ms).
SomeHelperClass:SaveSetting(encoder:GetString(ms:ToArray()))). /* receives DITEM error */
ms:Close().
ms:Dispose().
CLASS SomeHelperClass:
METHOD PUBLIC STATIC SaveSetting(INPUT dockManagerSettings AS LONGCHAR):
. . .
END METHOD.
END CLASS.
Doing this doesn't raise the DITEM error.
dockManagerSettings = encoder:GetString(ms:ToArray())).
Make sure to have at least 5 or more control panes with images and some colors overridben.
jquerijero schrieb:
SomeHelperClass:SaveSetting(encoder:GetString(ms:ToArray()))). /* receives DITEM error */
My assumption (experience) is more, that it's something to do with the ms:ToArray() than with the method expecting the LONGCHAR. Did you try to first create a Variable of type System.Array? As in:
DEFINE VARIABLE oArray AS System.Array NO-UNDO .
oArray = ms:ToArray() .
SomeHelperClass:SaveSetting(encoder:GetString(CAST(oArray, "System.Byte[]")).
Hmmm, but should the direct assignment I'm doing also show the same problem if that is the case?
Does my workaround change anything in the issue you are observing?
Hopefully this is also fixed.