---
title: "felskriving"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/46623-felskriving"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "caze"
published: "2002-06-25T19:25:46.000Z"
updated: "2002-06-25T21:15:24.000Z"
replies: 11
views: 265
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/46623-felskriving"
---

# felskriving

## #1 — caze, 2002-06-25T19:25Z

Testar lite If...Then... kodning och undrar över en sak:

Har skrivit in denna kod: 

> \<% Dim strEpost
> 	 strEpost = "info@info.com"
> %\>
> \<% If (strEpost <info@info.com> & <info2@info.com>)
>                 Then
> 	 Response.Write("Variabeln angav rätt E-post!")
> 	 Else
> 	 Response.Write("Variabeln angav fel E-post!")
> 	 End If
> %\>

 

Felet som jag inte förstår mig på sker vid rad 4 efter If (strEpost ... Vad är felet :q 

(Jag vill som ni säkert förstår att epostadresserna ska vara ett krav för att Then Response.Write ska köras, men det blir fel)

Tack på förhand...

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

## #2 — solbulle, 2002-06-25T19:29Z

Forumet tolkade din kod lite tokigt tror jag, testa med kodtaggarna så man ser vad det eg ska stå på raden:

\<% If (strEpost <info@info.com> & <info2@info.com>)

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

## #3 — @nders, 2002-06-25T19:39Z

Tja, fel är det, men exakt vad vill du att koden ska göra?

Mvh,

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

## #4 — caze, 2002-06-25T20:49Z

Koden blev inte densamma som jag skrev in: här kommer den igen:

                 If (strEpost <info@info.com> & <info2@info.com>)
	 Then
	 Response.Write("Variabeln angav rätt E-post!")
	 Else
	 Response.Write("Variabeln angav fel E-post!")
	 End If

Jag vill att rätt E-post ska skrivas ut om någon av de två nämnda epostadresserna nämns i strEpost variabeln... förstår du?

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

## #5 — @nders, 2002-06-25T20:53Z

Och om man provar med kod-taggar?

```
If strEpost = "info@info.com" or strEpost = "info2@info.com" Then 
Response.Write("Variabeln angav rätt E-post!") 
Else 
Response.Write("Variabeln angav fel E-post!") 
End If
```

Om jag förstod dig rätt...

Mvh,

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

## #6 — solbulle, 2002-06-25T20:54Z

If strEpost ="info@info.com" OR strEpost = "info2@info.com" then

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

## #7 — caze, 2002-06-25T21:01Z

thx, men nu uppstod ett annat problem: IE säger så här:

 Type mismatch: '\[string: "info2@info.com"\]' 

Vad menas?

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

## #8 — LarsG, 2002-06-25T21:05Z

Hur ser koden ut?

använd

&#91KOD\]

din kod

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

## #9 — caze, 2002-06-25T21:07Z

```
If (strEpost = "info@info.com" OR "info2@info.com") Then
Response.Write("Variabeln angav rätt E-post!")
Else
Response.Write("Variabeln angav fel E-post!")
End If
```

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

## #10 — @nders, 2002-06-25T21:08Z

```
If (strEpost = "info@info.com" OR [b]strEpost=[/b]"info2@info.com") Then
Response.Write("Variabeln angav rätt E-post!")
Else
Response.Write("Variabeln angav fel E-post!")
End If
```

Inte ta bort delar av det vi skriver... ;)

Mvh,

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

## #11 — caze, 2002-06-25T21:11Z

Det gjorde jag inte, jag glölmde skriva in strEpost andra gången ;)

När jag ändrade det så fungerade det! :)

Tack för hjälpen! :bire

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

## #12 — solbulle, 2002-06-25T21:15Z

> **@nders skrev:**
>
> Inte ta bort delar av det vi skriver... ;)

  :e

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/46623-felskriving
