Frågan#1
<%@ Language=VBScript%>
<%
Option Explicit
Dim objRegExp, intMatches
Dim intLimit, strError
Function collectData(intLimit)
strError = intLimit & " är inget godkänt datum. Vänligen formatera datumet enligt: ÅÅÅÅMM"
If len(intLimit) <> 6 Then
Response.Write strError
ElseIf len(intLimit) = 6 Then
'check string, only 0-9 allowed
Set objRegExp = New regexp
objRegExp.Global = true
objRegExp.IgnoreCase = true
objRegExp.Pattern = "[^0-9]"
Set intMatches = objRegExp.Execute(intLimit)
[B]If intMatches <> 0 Then '<-- line 20
Response.Write strError
Else
Response.Write "Jippi"
End If[/B]
End If
End Function
'# html-output
Response.Write "<html><head><title>Untitled</title></head><body>"
'run function to collect data
collectData(200303)
Response.Write "</body></html>"
%>
Kommenterar jag bort If-satsen som börjar på rad 20 så fungerar det, men om jag inte gör det så får jag felmess:
Feltyp:
Körningsfel i Microsoft VBScript (0x800A01C2)
Fel antal argument eller felaktig egenskapstilldelning.
/aspp/Default.asp, line 20
Vad gör jag för fel :q