关于delphi 判断问题?
我以前在VB里是这样写的~!
If (Text8.Text = "6.5" Or Text8.Text = "8" Or Text8.Text = "10" Or Text8.Text = "12") And (Label22.Caption >= -7 And Label22.Caption <= 7) Then
Label24 = "达到要求"
Label35 = "合格"
在delphi里
if (edit16.Text='6.5' or edit16.Text='8' or edit16.Text='10' or edit16.Text='12') and (label54.Caption >= '-7' and label54.Caption <= '7') then
label58.Caption:='达到要求'
label59.Caption:='合格'
为什么在label54.Caption <= '7' 位置错误?提示:Operator not applicable to this aperand type
请高手指点?我应该怎么写这段?
[解决办法]
if ((StrToInt(edit16.Text) in [8,10,12]) or (edit16.Text='6.5')) and ((StrToInt(label54.Caption) >= -7) and (strtoint(label54.Caption) <= 7)) thenbegin label58.Caption:='达到要求'; label59.Caption:='合格';end;