What datatype to use for .NET method that returns long strin

Posted by jquerijero on 10-Aug-2010 16:18

Since System.String is mapped to CHARACTER, how can you assign an output of a .NET object that exceeds the limit of CHARACTER datatype?

All Replies

Posted by Matt Baker on 10-Aug-2010 21:42

Longchar.

Here is an example:


define variable i as integer   no-undo.
define variable m as longchar  no-undo.
define variable d as character init "abcdefghijklmnopqrstuvwxyz" no-undo.

define variable x as System.Text.StringBuilder no-undo.

x = new System.Text.StringBuilder().


do i = 1 to 2000:
    x:append(d). 
end.

m = x:ToString().

message length(m) length(x:ToString())
    view-as alert-box.

Posted by jquerijero on 17-Aug-2010 16:04

I'm getting "unable to assign field" error when I do the same thing for myStream.ReadToEnd().

Also, is it safe to use these kind of methods as a parameter without using a secondary storage variable.

This thread is closed