比如:
ch,tempch:Char;
ch:=tempch and 0x01111111;
if (ch>01FH)then
begin
................
end;
编译不通过,我查了一下,帮助说and操作只适合于integer
请高人指点
ch,tempch:Char;
ch:=tempch and 0x01111111;
if (ch>01FH)then
begin
................
end;
编译不通过,我查了一下,帮助说and操作只适合于integer
请高人指点
ch,tempch:Char;
begin
tempch := #20;
ch := chr(ord(tempch) and $10);
if (ord(ch)>$FA)then
begin
//................
end;
end;用byte 比较简单,
还有,delphi 是用 $ 来表示十六进制
http://community.csdn.net/Expert/topic/3084/3084591.xml?temp=.848797
http://community.csdn.net/Expert/topic/3080/3080374.xml?temp=1.380557E-02
一楼的代码非常详细了,我只多说一句,字符转成字节进行位处理,完了再转加字符就行了,和C不一样,char和int可以转,这是严格区分,算是不同类型。
ch,tempch:Char;
begin
tempch := chr($7F);
ch := chr(Ord(tempch) and $7f);
if (ord(ch)>$1f)then
begin
showmessage('asdfasdf');
end;
end;
var
tempstr,hello:String;
i,j:integer;
begin
j:=1;
hello:='hello';
for i:=1 to length(hello) do
begin
if((ord(hello[i])and $01111111)>$00111111)then
begin
tempstr[j]:=hello[i];
inc(j);
end;
end;
memo1.lines.add(tempstr);
end;
在memo1中什么都没有输出,tempstr中并没有等于'hello',这是怎么
回事啊?