Don't initialize STRING values to null. STRINGs contain an array of
bytes initialized to 8-bit character values, and trying to copy a null
value will abort the copy operation. The correct way to initialize a
STRING is:
aSTRING.initialize("\'Some initialization string\'");
The contained single-quote delimiters are mandatory, but will not be
copied to the internal byte array.
If you want to have just a normal Java String as the value then use
WSTRING. Then you can say
aWSTRING.value = ("Another initialization string");
See the difference?
On May 19, 6:02 am, William Dai <
william...@gmail.com> wrote:
> Hi Jim
>
> Thanks for your reply. I tried to use copyFrom it works. But when it
> tried to copy a STRING type data in the data structure, it failed.
>
> My Data structure contains:INT, STRING, and Data structure inside Data
> structure.
>
> I initialize my STRING type with .value = null. and copyFrom() only
> copied first element in the Data structure of Data structure. Rest of
> the data still 0s or null. Have you got any idea? Thanks a lot.
>
> On Tue, May 19, 2009 at 1:31 AM, James Christensen
>
>
>
> <
james.h.christen...@gmail.com> wrote:
>
> > Try DataStructureInstance1.copyFrom(DataStructureInstance2). That
> > should do a deep copy.
> > - Jim C
>