---
title: "Inkompatibla typer"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/13582-inkompatibla-typer"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "ampy"
published: "2002-01-04T23:07:00.000Z"
updated: "2002-01-05T20:02:00.000Z"
replies: 5
views: 254
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/13582-inkompatibla-typer"
---

# Inkompatibla typer

## #1 — ampy, 2002-01-04T23:07Z

Vad är det för fel på denna rad:

```
	

	If DateDiff("s", DateAdd("s", 0, Left(thisLine, 19)), Time) => 120 Then Exit For '120 sekunder = 2 minuter
```

Felmeddelande blev:

```
Körningsfel i Microsoft VBScript (0x800A000D)
Inkompatibla typer: '[string: "00:03:20&#0124;public&#0124;And"]'
/Ampy/chat1234/room.asp, line 124
```

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

## #2 — LarsG, 2002-01-04T23:14Z

Hur ser thisLine ut?

Felmeddelandet beror på att argumenten till dateadd skall vara av subtypen date och inte string.

Kan du förklara lite mer vad du vill göra?

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

## #3 — ampy, 2002-01-04T23:16Z

Vänta...

\[Redigerat av ampy den 05 jan 2002\]

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

## #4 — ampy, 2002-01-04T23:18Z

Fattar inte riktigt vad du menar men jag kan vissa lite mer kod: 

```
<%
Set fileObject = Server.CreateObject("Scripting.FileSystemObject")
CheckFile
Set inStream = fileObject.OpenTextFile(Server.MapPath("" & Date & ".txt"), 1, True, False)

	rawfile = inStream.ReadAll

	splittedFile = Split(rawfile, vbCrLf)

	For Each thisLine in splittedFile

		If Len(thisLine) <= 3 Then Exit For
		If DateDiff("s", DateAdd("s", 0, Left(thisLine, 19)), Now) => 120 Then Exit For '120 sekunder = 2 minuter

		file = file & vbCrLf & ParseText(thisLine)
	Next

inStream.Close
Set inStream = Nothing

If IsOnline(Session("Name")) = "True" Then
	strText = Request.Form("lastmessage")
	If strText <> "" And Session("lastmessage") <> strText Then
		Session("lastmessage") = strText
		If LCase(Left(strText, 6)) = "/msg " & chr(34) Then
			strTo = Mid(strText, 7, Instr(7, strText, Chr(34)) - 7)
		Else
			strTo = "public"
		End If

		file = ParseText(Now & "&#0124;" & strTo & "&#0124;" & Session("Name") & "&#0124;" & strText) & file
		rawfile = Time & "&#0124;" & strTo & "&#0124;" & Session("Name") & "&#0124;" & strText & vbCrLf & rawfile

		Set outStream = fileObject.CreateTextFile(Server.MapPath("" & Date & ".txt"), True)
		outStream.WriteLine(rawfile)
		outStream.Close
		Set outStream = Nothing
	End If
Else
	Session("Name") = ""
	Session("Admin") = ""
	Session("lastmessage") = ""
	%>
```

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

## #5 — Harback, 2002-01-04T23:21Z

\=\> ska vara \>=

eller det kanske inte spelar någon roll?

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

## #6 — LarsG, 2002-01-05T20:02Z

Jag undrar bara vad det finns för data i filen date.txt?

Det jag inte förstår är hur du skulle kunna tolka de 19 första tecknen på varje rad som ett klockslag.

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/13582-inkompatibla-typer
