for i=1 to lenc(stringhz)
chz=substrc(stringhz,i,1)
if len(chz)=2 and Asc(left(chz, 1))>=0xB0 and Asc(left(chz, 1))<=0xF7
ctemp=ctemp+chz
endif
endfor
以上是vf写的,我想用dephi把它翻译过来,Asc(left(chz, 1))>=0xB0 不只怎么写?谢谢!
chz=substrc(stringhz,i,1)
if len(chz)=2 and Asc(left(chz, 1))>=0xB0 and Asc(left(chz, 1))<=0xF7
ctemp=ctemp+chz
endif
endfor
以上是vf写的,我想用dephi把它翻译过来,Asc(left(chz, 1))>=0xB0 不只怎么写?谢谢!
上面那句就是下面的意思:
type
TChnChar = string[2];
var
S: TChnChar;
begin
S := '军';
if (length(S) = 2) and (WORD(S[1]) >= $B0) and (WORD(S[1]) <= $D7) then
Showmessage('$' + IntToHex((WORD(S[1]) shl 8 + WORD(S[2])),4));
end;
function HexToStr(const sMsg:string;var acMsg:array of char):integer;
var
iLen:integer;
begin
fillchar(acmsg,sizeof(acmsg),0);
iLen:=length(sMsg);
HexToBin(pchar(sMsg),acMsg,iLen);
result:=0;
end;
//sMsg:='C4FABAC321BBB6D3ADB6A9D4C4B8C3D2B5CEF1';
HexToStr(pchar(sMsg),acMsg);参数说明:sMsg,原msg,acmsg拉收值,
function StrToHex(const sMsg:string;var acMsg:array of char):integer;
var
iLen:integer;
begin
fillchar(acmsg,sizeof(acmsg),0);
iLen:=length(sMsg);
bintohex(pchar(sMsg),acMsg,iLen);
result:=0;
end;
////sMsg:='您好!欢迎订阅该业务';
StrToHex(pchar(sMsg),acMsg);超额完成任务,多给点分呀!!!!!!!!!!!!!!!!!
sMsg:='C4FABAC321BBB6D3ADB6A9D4C4B8C3D2B5CEF1';
hextostr(sMsg,acMsg);
showmessage(StrPas(acMsg));