L
laijf
Unregistered / Unconfirmed
GUEST, unregistred user!
请高手帮忙翻译一下,DELPHI怎么写,主要是第一段
//---------------------------------------------------------------------------
//1
BYTE linshi;
BYTE *content;
linshi=deliver_inst.code_mess;
union hanzi
{
long hanzi_int;
BYTE hanzi_byte;
} mess_hanzi;
union trans
{
long tr_lg;
BYTE con[2];
}ansi_tran;
long changdu;
AnsiString mess_content;
byte con[2];
BYTE *change;
//---------------------------------------------------------------------------
//2
if((int)linshi==11 || (int)linshi==8)//UCS2编码
{
linshi=deliver_inst.len_mess[3];
content=deliver_inst.mess;
for(int i=0;i<(int)linshi;i=i+2)
{
mess_hanzi.hanzi_byte=content;
ansi_tran.con[1]=mess_hanzi.hanzi_int;
mess_hanzi.hanzi_byte=content[i+1];
ansi_tran.con[0]=mess_hanzi.hanzi_int;
changdu=ansi_tran.tr_lg;
mess_content=mess_content+AnsiString(WideString(changdu));
}
}
else
{
change=deliver_inst.mess;
mess_content=(char *)change;
}
//---------------------------------------------------------------------------
//1
BYTE linshi;
BYTE *content;
linshi=deliver_inst.code_mess;
union hanzi
{
long hanzi_int;
BYTE hanzi_byte;
} mess_hanzi;
union trans
{
long tr_lg;
BYTE con[2];
}ansi_tran;
long changdu;
AnsiString mess_content;
byte con[2];
BYTE *change;
//---------------------------------------------------------------------------
//2
if((int)linshi==11 || (int)linshi==8)//UCS2编码
{
linshi=deliver_inst.len_mess[3];
content=deliver_inst.mess;
for(int i=0;i<(int)linshi;i=i+2)
{
mess_hanzi.hanzi_byte=content;
ansi_tran.con[1]=mess_hanzi.hanzi_int;
mess_hanzi.hanzi_byte=content[i+1];
ansi_tran.con[0]=mess_hanzi.hanzi_int;
changdu=ansi_tran.tr_lg;
mess_content=mess_content+AnsiString(WideString(changdu));
}
}
else
{
change=deliver_inst.mess;
mess_content=(char *)change;
}