【问题标题】:Boolean evaluation error: Incompatible types布尔评估错误:不兼容的类型
【发布时间】:2012-02-26 04:02:08
【问题描述】:

我正在尝试在我的代码中将布尔变量 (curs) 设置为 false,但出现此错误:

[错误] Main.pas(50): 不兼容的类型

有人知道这是什么意思吗?

if form1.Left = pt.X and form1.Top = pt.Y
then curs := false;

如果您知道或对发生的事情有任何想法,请随时分享。 :) 谢谢

-connorbp

【问题讨论】:

  • 向我们展示更多代码,特别是curs的定义,并告诉我们这是第50行。
  • 这将是很好的重新措辞更通用。

标签: delphi variables boolean delphi-7 pascal


【解决方案1】:

那是因为你需要把相等检查放在括号之间,像这样:

if ( form1.Left = pt.X ) and ( form1.Top = pt.Y ) then
  curs := false;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多