Does the limitation of CHAR/LONGCHAR still exists in GUI for

Posted by jquerijero on 14-Jul-2009 14:15

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.

All Replies

Posted by jquerijero on 22-Jul-2009 14:31

Can you turn off the DITEM checking?

Posted by Admin on 22-Jul-2009 14:36

Do you have a code sample of what is failing?

Posted by jquerijero on 22-Jul-2009 15:04

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.

Posted by Admin on 22-Jul-2009 15:38

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[]")).


That way you'll get around the AVM creating an ABL array for the result of ms:ToArray(). That usually helps when dealing with "large" .NET Arrays.

Posted by jquerijero on 22-Jul-2009 17:02

Hmmm, but should the direct assignment I'm doing also show the same problem if that is the case?

Posted by Admin on 22-Jul-2009 17:19

Does my workaround change anything in the issue you are observing?

Posted by jquerijero on 13-Mar-2013 10:30
This thread is closed