str = "1,5,10,20,30,50,75,100,200,300,500" talArray = split(str,",") checkStr = "-1,-1,-1" checkArr = split(checkStr,",") Randomize cont = 0 while (cont < 3) tal = int(rnd * UBound(talArray)) check = true for i = 0 to UBound(checkArr) if tal = checkArr(i) then check = false end if next if check <> false then response.write talArray(tal) checkArr(cont) = tal cont = cont+1 end if wend %>
Har lige lavet medions funktion lidt om... Prøv med denne:
talArr = split("1,5,10,20,30,50,75,100,200,300,500,0",",") checkArr = split("0,0,0,0,0,0,0,0,0,0,0",",") Randomize cont = 0 While (cont < 11) tal = int(rnd() * UBound(talArr)) check = True For i = 0 To UBound(checkArr) if tal = checkArr(i) then check = False end if Next If check <> False Then response.write talArr(tal) & " - " checkArr(cont) = tal cont = cont+1 End If Wend
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.