

没有参数的VBScript Sub过程代码示例
<html>
<head>
<title>没有参数的 VBScript Sub 过程代码示例</title>
<script type="text/vbscript">
sub myProc()
msgbox "欢迎来到正佳科技 www.kingar.com"
end sub
</script>
</head>
<body>
<script type="text/vbscript">
call myProc()
</script>
<p>VBScript Sub 过程不返回值。</p>
</body>
</html>
演示结果:
www.kingar.com
带参数的VBScript Sub过程代码示例
<html>
<head>
<title>VBScript Sub 过程代码示例</title>
<script type="text/vbscript">
Sub myMulti(no1, no2)
MsgBox (no1*no2)
End Sub
</script>
</head>
<body>
<script type="text/vbscript">
myMulti 8,9
</script>
</body>
</html>
演示结果:72
用Call语句调用VBScript Sub过程代码示例
<html>
<head>
<title>VBScript Sub 过程代码示例</title>
<script type="text/vbscript">
Sub myMulti(no1, no2)
MsgBox (no1*no2)
End Sub
</script>
</head>
<body>
<script type="text/vbscript">
call myMulti(8,9)
</script>
</body>
</html>
演示结果:72
VBScript Function 过程代码示例
<html>
<head>
<title>VBScript Function 过程代码示例</title>
<script type="text/vbscript">
Function myMulti(no1, no2)
myMulti = no1*no2
End Function
</script>
</head>
<body>
<script type="text/vbscript">
dim vNo
vNo = myMulti(8,9) + 100
MsgBox vNo
</script>
</body>
</html>
演示结果:172