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

delphi中出现这种有关问题 Operator not applicable to this operand type如何解决?待,

2012-06-20 
delphi中出现这种问题 Operator not applicable to this operand type怎么解决?在线等待,急急急!if (self.

delphi中出现这种问题 Operator not applicable to this operand type怎么解决?在线等待,急急急!
if (self.ComboBox1.Text='学号') or (self.ComboBox1.Text='姓名') then
 begin
 self.ComboBox2.Enabled:=false;
 self.ComboBox3.Enabled:=false;
 self.ComboBox4.Enabled:=false;
 end
 else
 begin
 self.ComboBox2.Enabled:=true;
 self.ComboBox3.Enabled:=true;
 self.ComboBox4.Enabled:=true;
 if (self.ComboBox1.Text:='系部')or (self.ComboBox1.Text:='专业')then
 begin
 DataM.deptTQ.SQL.Text:='select * from DeptT';
 DataM.deptTQ.Active:=true;
 while not DataM.deptTQ.Eof do
 begin
  self.combobox2.Items.Add(DataM.deptTQ.FieldValues ['DeptName']) ;
  DataM.deptTQ.Next;
 end;

 end;

 end;
运行时出现 Operator not applicable to this operand type这个问题怎么解决的啊,请高手帮忙!

[解决办法]
if (self.ComboBox1.Text:='系部')or (self.ComboBox1.Text:='专业')then 
前面的那个写对了,为什么这个写错了呢?呵呵,真粗心
if (self.ComboBox1.Text='系部')or (self.ComboBox1.Text='专业')then 
把":"去掉,判断的语句中需要加冒号的

热点排行