Hi All,
I am exploring using UniDynArray.
My Sample Code
String xVM = Convert.ToChar(253).ToString();
string inS = "H1" + xVM + "H2" + xVM + "H3";
U2.Data.Client.UO.UniSession ses = U2.Data.Client.UO.UniSession.NullSession(null,Encoding.Unicode);
var dynArray = ses.CreateUniDynArray(inS);
var s = dynArray.ToString();
MessageBox.Show(dynArray.Extract(1, 1).StringValue);
MessageBox.Show(dynArray.Extract(1, 2).StringValue);
Issue:
My first MessageBox is correct, but the 2nd one is showing me some rubbish..
------------------------------
Koon MIng Fong
Mr
P & O Global Technologies SDN. BHD.
KUALA LUMPUR MY
------------------------------
Any help here ?
------------------------------
Koon MIng Fong
Mr
P & O Global Technologies SDN. BHD.
KUALA LUMPUR MY
------------------------------
Any help here ?
------------------------------
Koon MIng Fong
Mr
P & O Global Technologies SDN. BHD.
KUALA LUMPUR MY
------------------------------
Hi, what version of Visual Studio are you using?
------------------------------
Sergio Perin
Ing.
Self Registered
Buenos Aires AR
------------------------------
Any help here ?
------------------------------
Koon MIng Fong
Mr
P & O Global Technologies SDN. BHD.
KUALA LUMPUR MY
------------------------------
UniDynArray dynArray = new UniDynArray(ses,"H1"+xVM+"H2"+xVM+"H3");
MessageBox.Show(dynArray.Extract(1, 1).StringValue);
MessageBox.Show(dynArray.Extract(1, 2).StringValue);
MessageBox.Show(dynArray.Extract(1, 3).StringValue);
------------------------------
Phillip Potter
V.P. R&D
Data Management Associates Inc DMA
Cincinnati OH US
------------------------------
Hi All,
I am exploring using UniDynArray.
My Sample Code
String xVM = Convert.ToChar(253).ToString();
string inS = "H1" + xVM + "H2" + xVM + "H3";
U2.Data.Client.UO.UniSession ses = U2.Data.Client.UO.UniSession.NullSession(null,Encoding.Unicode);
var dynArray = ses.CreateUniDynArray(inS);
var s = dynArray.ToString();
MessageBox.Show(dynArray.Extract(1, 1).StringValue);
MessageBox.Show(dynArray.Extract(1, 2).StringValue);
Issue:
My first MessageBox is correct, but the 2nd one is showing me some rubbish..
------------------------------
Koon MIng Fong
Mr
P & O Global Technologies SDN. BHD.
KUALA LUMPUR MY
------------------------------
The problem is when you create the session you are specifying a Unicode map.
The VM is a Unicode leader character (utf8 and utf16) which mangles the following string - if you look at the byte array underneath the dynarray you will see that it has added a \\0 for each one, so presumably that works for the first value (scans to the first 253) and then screws up the following as the next byte is a zero.
Always problems with mapping between UniVerse marker characters and Unicode.
Change to:
var ses = U2.Data.Client.UO.UniSession.NullSession(null);
and it will show the correct result.
------------------------------
Brian Leach
Director
Brian Leach Consulting
Chipping Norton GB
------------------------------
The problem is when you create the session you are specifying a Unicode map.
The VM is a Unicode leader character (utf8 and utf16) which mangles the following string - if you look at the byte array underneath the dynarray you will see that it has added a \\0 for each one, so presumably that works for the first value (scans to the first 253) and then screws up the following as the next byte is a zero.
Always problems with mapping between UniVerse marker characters and Unicode.
Change to:
var ses = U2.Data.Client.UO.UniSession.NullSession(null);
and it will show the correct result.
------------------------------
Brian Leach
Director
Brian Leach Consulting
Chipping Norton GB
------------------------------
Hi I tried..its not showing any rubbish..but the result is NOT correct.
The first msg box
The 2nd msg box
------------------------------
Koon MIng Fong
Mr
P & O Global Technologies SDN. BHD.
KUALA LUMPUR MY
------------------------------