---
title: "Slumpning?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/84895-slumpning"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "asp"
published: "2003-08-31T11:27:04.000Z"
updated: "2003-08-31T17:25:56.000Z"
replies: 1
views: 274
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/84895-slumpning"
---

# Slumpning?

## #1 — asp, 2003-08-31T11:27Z

Hej!

Jag vill slumpa fram 5 bokstäver och 5 siffror mellan a-z och 1-9. Sedan vill jag att strängen strHej skall få det värdet.

plz.

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

## #2 — Vide, 2003-08-31T17:25Z

Med [getRndNr](http://www.webeye.nu/f/topic.asp?TOPIC_ID=15)  kan du lätt fixa det.

```
function getRndNr( lowbound, uppbound )
	Randomize()
	getRndNr = int( ( ( lowbound ) - ( uppbound + 1 ) ) * RND + ( uppbound + 1 ) )
end function

strHej = ""

for i = 1 to 5
  strHej = strHej & chr( getRndNr( 97, 122 ) )
next

for i = 1 to 5
  strHej = strHej & getRndNr( 1, 9 )
next
```

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/84895-slumpning
