此句通不过 vhigh:=char(((ch_numb and $03)shl 6)or(value1 and $0f)) 阿!(15分)

  • 主题发起人 主题发起人 mazheng
  • 开始时间 开始时间
M

mazheng

Unregistered / Unconfirmed
GUEST, unregistred user!
此句通不过 vhigh:=char(((ch_numb and $03)shl 6)or(value1 and $0f)) 阿!
[Error] MainUnit.pas(489): Operator not applicable to this operand type
 
此句通不过 vhigh:=char(((ch_numb and $03)shl 6)or(value1 and $0f)) 阿!
[Error] MainUnit.pas(489): Operator not applicable to this operand type



procedure TMainFrm.DA(baseadd:Word;ch_numb:char;value:Single);
var value2:Single;
vhigh,vlow:char;
value1:integer;
begin
value2:=409.5*value+2047.5;
value1:=trunc(value2);
vlow:=char(value1 and $ff);
vhigh:=char(((ch_numb and $03)shl 6)or(value1 and $0f));
end;
 
char类型不能用来做逻辑运算,
改为:ord(ch_numb) and $03就可以通过
 
后退
顶部