Ch06-02-05.aspx 调用程序的方法
' 被调用的FunctionA程序
Function FunctionA(ByVal VarA As String) As String
Response.Write("程序名称:FunctionA()")
Response.Write("输入的数据为:" & VarA & "")
End Function
' 具有输出值的FunctionB程序
Function FunctionB(ByVal VarA As Integer) As Integer
Dim I as Integer
For I = 1 to VarA
FunctionB += I
Next
End Function
Dim strA As String, intA As Integer , intB As Integer = 10
strA = "直接调用FunctionB程序!"
' 直接调用Function函数
Response.Write(FunctionA(strA) & "")
' 成为表达式的一部分
intA = FunctionB(intB) * 10
Response.Write("FunctionB()程序是一个 1 加到 N 的程序,")
Response.Write("调用FunctionB()程序获取输出值并 * 10 的结果:" & intA)
%>