<%
Dim M = Val( Request("Month") )
Response.Write( M & " 的中文月份为 " & ChineseMonthName(M) )
%><script Language="VB" runat="server">
Function ChineseMonthName(X)
Dim M() = {"一月", "二月", "三月", "四月", _
"五月", "六月", "七月", "八月", _
"九月", "十月", "十一月", "十二月"}
If X >= 1 And X <= 12 Then
Return M (X-1)
Else
Return "输入错误!"
End If
End Function
</script>上面(x-1)是为什么?
Dim M = Val( Request("Month") )
Response.Write( M & " 的中文月份为 " & ChineseMonthName(M) )
%><script Language="VB" runat="server">
Function ChineseMonthName(X)
Dim M() = {"一月", "二月", "三月", "四月", _
"五月", "六月", "七月", "八月", _
"九月", "十月", "十一月", "十二月"}
If X >= 1 And X <= 12 Then
Return M (X-1)
Else
Return "输入错误!"
End If
End Function
</script>上面(x-1)是为什么?
M(0) 一月
M(1) 二月
M(2) 三月
.....