delphi7.0编译出现问题,请高手们指导一下

来源:百度知道 编辑:UC知道 时间:2024/09/20 22:49:29
如果有两种条件都需要满足,用if then else语句怎样编
我用了if (条件1)and (条件) then else 提示语法错误

if (条件) then
if (条件2) then (结果1)
else (结果2) 这种不显示(结果2)

用if (条件1) then
begin
if (条件2) then
结果1
end
else 结果2 这种出现第一种条件满足的话就不出现(结果2)
高手大侠们,请帮帮我
不管(条件1)不正确,或(条件2)不正确,都显示结果2

用这个if (条件1)and (条件) then else 是 条件要加上括号
如:if (str1='') and (str2='') then edit1.text:=str1
else edit1.text:=str2;

把代码贴出来吧,估计你的else语法错误要么是 then和else中间有多个语句却没有用begin。。end,要么是else前面的最后一句后面有;号,这是新手常见的错误。至于出来结果与预想不一样,一般是程序设计的逻辑错误,好好再查查代码,不行的话,画画流程图吧