---
title: "Fel antal argument eller felaktig egenskapstilldelning."
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/77031-fel-antal-argument-eller-felaktig-egenskapstilldelning"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Dee"
published: "2003-05-15T09:43:51.000Z"
updated: "2003-05-15T12:17:25.000Z"
replies: 2
views: 476
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/77031-fel-antal-argument-eller-felaktig-egenskapstilldelning"
---

# Fel antal argument eller felaktig egenskapstilldelning.

## #1 — Dee, 2003-05-15T09:43Z

```
<%@ Language=VBScript%>
<%

Option Explicit
Dim objRegExp, intMatches
Dim intLimit, strError 

Function collectData(intLimit)
strError = intLimit & "&nbsp;&auml;r inget godk&auml;nt datum. V&auml;nligen formatera datumet enligt: &Aring;&Aring;&Aring;&Aring;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

Permalänk: https://www.webforum.nu/p/77031

## #2 — LarsG, 2003-05-15T10:27Z

IntMatches är ett object  

```
If intMatches.count <> 0 Then
```

Permalänk: https://www.webforum.nu/p/1049867

## #3 — Dee, 2003-05-15T12:17Z

Tack LarsG.

Permalänk: https://www.webforum.nu/p/1049932

---

Tråden på webben: https://www.webforum.nu/amne/asp/77031-fel-antal-argument-eller-felaktig-egenskapstilldelning
