首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

关于delphi 判断有关问题

2012-05-01 
关于delphi 判断问题?我以前在VB里是这样写的~!If (Text8.Text 6.5 Or Text8.Text 8 Or Text8.Tex

关于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 

请高手指点?我应该怎么写这段?

[解决办法]

Delphi(Pascal) code
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; 

热点排行