请问if ti='1' or ti='2' then Label35.Caption:='正确';这条语句错在哪里?

来源:百度知道 编辑:UC知道 时间:2024/04/28 14:22:59
老是通不过,请教大师,到底错在哪里?

修改为:
if (ti='1') or (ti='2') then Label35.Caption:='正确';

你要仔细看错误提示,提示说类型不匹配,就是说'1'不能进行or运算,那就是因为优先级的问题。

if ti='1' or ti='2' then Label35.Caption="正确"最后是字符串,所以用双引号。

英文状态下的标点