我正在尝试创建一个函数来检查有效学期,例如秋季 #### 或春季 ####,但我一直收到此错误
Microsoft VBScript 编译错误“800a03f6”应为
“结束”
否则
^
这是我的代码...
Function IsSemester(UserInput)
' Validation: Spring, Fall
Temp=UserInput
If Len(Temp)=9 Then IsSemester=True
For P=1 to 4
If Left(Temp,P,1)<>"Fall" Then IsSemester=False
Next
If Mid(Temp,5,1)<>" " Then IsSemester=False
For P=6 to 9
If Not IsInteger(Mid(Temp,P,9)) Then IsSemester=False
Next
Else
IsSemester=True
End If
If Len(Temp)=11 Then IsSemester=True
For C=1 to 6
If Left(Temp,C,6)<>"Spring" Then IsSemester=False
Next
If Mid(Temp,7,1)<>" " Then IsSemester=False
For C=8 to 11
If Not IsInteger(Mid(Temp,8,11)) Then IsSemester=False
Next
Else
IsSemester=True
End If
End Function