VB 中if 语法怎么用

来源:百度知道 编辑:UC知道 时间:2024/05/17 20:44:26
VB 中if 语法怎么用
条件中的条件的条件语句应怎么写

if 条件 then
语句
else
语句
end if

if 条件 then
语句
end if

if 条件 then 语句

if 条件 then
语句
elseif 条件 then
语句
end if

if 条件 then
语句
elseif 条件 then
语句
elseif 条件 then
语句
else
语句
end if

DIM a AS INTEGER
a=? 你可以给a 整数值(100,200,1,2,0)
if a >0 then
msgbox "输入有错误"
else
msgbox "输入正确"
end if
a 是定义变量

同意楼上

条件可为:表达式(判断、循环、逻辑)