assassinator
26th May 2008, 10:52
Now I want to print Item Text in report. And Item Text maybe include Chinese. So I write the code as following:

txta.num = text.to.buf("txtn.ptr",language$,50,text.buf)
for i = buf.line to txta.num
txta.str = text.buf(1,i)
mb.import$(txta.str,txta.str)


This would call a trouble. Now the Item Text is "POLARIZER-ASN-3245RTP5700\45". After executed "mb.import$(txta.str,txta.str)", the Item Text has changed to "POLARIZER-ASN-3245RTP5700-".

I thought function mb.import$() would change the value "\45" to ASCII Code. Because the character "-" corresponding to the digital 45.

How terrible! What is the right way to solve this problem simply.
(Item Text would include Chinese or "\")

zardoz
26th May 2008, 16:55
text.buf is declared as mb string array?

assassinator
27th May 2008, 08:38
text.buf is declared as mb string array?

No, I declared it as string only.

zardoz
27th May 2008, 16:47
Try to declare it mb then :)

assassinator
28th May 2008, 04:44
Try to declare it mb then :)

Oh, I have done as you said. But it can't solve the problem completely.

I defined text.buf and text.str as domain Multi byte string. It would be work to the first line. And the first line must include characters and digital only, not for chinese. At second line and the following the characters, digital and chinese all display error.

Like: Item Text is "POLARIZER-ASN-3245RTP5700\AA" then display "POLARIZER-ASN-3245RTP5700AA". The character '\" would nonprinting. If the following character "\" is a digital, it would change to ASCII Code also. Text "POLARIZER-ASN-3245RTP5700\45" would display "POLARIZER-ASN-3245RTP5700-".
So only change variable's domain would not in effect.