1.Sub过程
Sub过程是包含在Sub和End Sub语句之间的一组VBScript语句,执行操作但没有返回值。
Sub Add()
Dim i,j,h
i=1
j=2
h=i+j
MsgBox h
End Sub
2.Function过程
Function过程和Sub过程是类似,但是Function过程可以有返回值
Sub Convert()
temp=InputBox("请输入华氏温度",1)
MsgBox "温度为"&Celsius(temp)&"摄氏度"
End Sub
Function Celsius(t)
Celsius=(t-32)*5/9
End Function