delphi - 在delphi上比较字符串得到错误不兼容的类型

标签 delphi

我有这个代码:

if (conexao.FieldValues['complex'] = '02' and conexao.FieldValues['financ'] = '04') then
conexao.FieldValues['complex']是一个字符串,'02' 也是一个字符串,但我得到一个错误:

Incompatible types: 'string' and 'Boolean'



为什么?

最佳答案

运算顺序表示=and 之后进行评估.您需要使用 ()强制按您想要的顺序进行评估。

enter image description here

关于delphi - 在delphi上比较字符串得到错误不兼容的类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52915781/

相关文章:

delphi - 控制台应用程序安装为服务

使用 XSLT 3.0 的 JSON 到 XML - 如何加载 JSON 源并调用 json-to-xml 函数?

java -\G 在 PCRE 后视中如何工作

delphi - 调整列宽 DBGrid

delphi - 如何在 Delphi 中使用 RTTI 或 TypeInfo 获取枚举的有效范围

Delphi Firebird UDF 仅返回一个字符

Delphi XE : idHttp & Request. 范围,一个错误?

android - Delphi XE5 Android 中的广播接收器

delphi - 如何检测本地网络中其他设备的IP地址?

delphi - SOAP 客户端中的 Array_Of_Int