同样是判断语句但是这个有什么不同语法是怎么样的?
if 是判断条件语句case是选择性判断 根据不同情况使用不同的语句例如 判断文本框有没有输入内容 一般用 ifif text1.text="" then elseendif判断输入的值在某一个区间 用 caseSelect case val(text1.text)case 0......case Is 100 to200 .....case elseend select
温馨提示:答案为网友推荐,仅供参考
第1个回答 2013-09-25
if常用于不同变量判断进行选择,Case 主要用于同一变量的不同取值进行选择。
第2个回答 推荐于2018-04-24
if和case用于选择分支语句。依不同情况选择使用。
if 语法有,
1. if 条件1 then 语句
2. if 条件1 then
语句块
end if
3.if 条件1 then
语句块
elseif 条件2 then
……
end if
其中语法3为if嵌套。
case
1. select case 表达式
case 常量1
语句块1
case 常量2
语句块2
……
end select
2.
select case 表达式
case 常量1 to 常量2
语句块
…
end select本回答被网友采纳
if 语法有,
1. if 条件1 then 语句
2. if 条件1 then
语句块
end if
3.if 条件1 then
语句块
elseif 条件2 then
……
end if
其中语法3为if嵌套。
case
1. select case 表达式
case 常量1
语句块1
case 常量2
语句块2
……
end select
2.
select case 表达式
case 常量1 to 常量2
语句块
…
end select本回答被网友采纳