---
title: "-25 inte mindre än 1?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/87647-25-inte-mindre-än-1"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "LR^evil.sid"
published: "2003-10-04T21:44:05.000Z"
updated: "2003-10-05T00:04:55.000Z"
replies: 6
views: 256
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/87647-25-inte-mindre-än-1"
---

# -25 inte mindre än 1?

## #1 — LR^evil.sid, 2003-10-04T21:44Z

Resultatet efter utskriften: -25

```
EnVar = -25
If Int(EnVar) > 18 Then EnVar = 18: If Int(EnVar) < 1 Then EnVar = 1
Response.Write EnVar
```

Hur kommer det sig?

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

## #2 — Broskan, 2003-10-04T22:12Z

Mindre än

Vet inte vad du skall göra men så då. Då blir det ju 1.

EnVar = -25
If CInt(EnVar) \> 18 Then EnVar = 18
If CInt(EnVar) \< 1 Then EnVar = 1
Response.Write EnVar

//Broskan

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

## #3 — LR^evil.sid, 2003-10-04T22:15Z

Varför måste jag göra en CInt()? Borde det inte räcka med Int()?

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

## #4 — Nexus86, 2003-10-04T22:31Z

Det borde räcka men antagligen så tolkar ASP -25 som en sträng. :)

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

## #5 — niko, 2003-10-04T23:10Z

VB-scripttolken tolkar:

```
If Int(EnVar) > 18 Then EnVar = 18: If Int(EnVar) < 1 Then EnVar = 1
```

som: 

```
If Int(EnVar) > 18 Then 
	EnVar = 18
	If Int(EnVar) < 1 Then 
		EnVar = 1
	end if
end if
```

och inte som:

```
If Int(EnVar) > 18 Then EnVar = 18
If Int(EnVar) < 1 Then EnVar = 1
```

(vilket man lätt skulle kunna tro). Det är *det* som är problemet, inte CInt eller Int (ingen av dem behövs i det här fallet).

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

## #6 — Nexus86, 2003-10-04T23:12Z

Just det. Nu när du säger det verkar det lite bekant. :)

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

## #7 — LR^evil.sid, 2003-10-05T00:04Z

Så klart!

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/87647-25-inte-mindre-än-1
