帮忙解释一下下面的if嵌套语句?

来源:百度知道 编辑:UC知道 时间:2024/05/14 18:06:06
请问下面的嵌套if语句如何理解,快吧把我弄晕了。详细点!

if a then b
if c then d
else
if e then f else g end if
if h then f
else l
end if
end if

if a then b
if c then d
else
if e then f else g end if
if h then f else l end if
end if

缩进一下你就明白了.
就是
if [条件] then
[代码]
end if


if [条件] then
[代码]
else
[代码]
end if

代码部分可以是另一个if语句
但都少不了if 。。。end if的格式

if a then b
if c then d
else if e then f
else g
end
if
if h then f
else l
end
if
end
if