- Public Function foo1(ByVal test As Boolean) As Integer
- Dim i As Integer
- If (test) Then
- i = 1
- Else
- i = 2
- End If
- 'Return i
- End Function
integer | 只能放 号码 |
string | 只能放 字—号码 |
boolean | 只能放 对错 有没有 |
double | 只能放 有小数点 |
dim a as integer
我定义一个 空间 是 名 a 类型是 integer 号码
a = 1
这样也可以
dim a as integer = 1
if a = 1 then
msgbox("i m " & a)
end if
结果是
1
- if a <> 1 then
- msgbox("i m not")
- else
- msgbox("i m" & a)
- end if
如果 a 不等于 1 就
msgbox("i m not")
否则全部 都是
msgbox("i m" & a)
=======================================
- if a <> 1 then
- todo
- elseif a <> 2 then
- todo
- elseif a <> 3 then
- todo
- elseif a <> 4 then
- todo
- elseif a <> 5 then
- todo
- else
- todo
- end if
随便写 可能有错的