Støv, fibre og metalliske partikler kan påvirke både uptime, levetid og driftssikkerhed. Derfor arbejder flere datacentre systematisk med contamination control.
jep Men hvis du har 12 representeret 4 gange, ønsker du så at få at vide fire gange at tolv eksisterer fire gange? For ellers skal du også holde styr på om du allerede har talt elementet op ,o)
basket = "23,23,12,9,123,129,12,12,12" arrBasket = Split(basket,",") set w = Server.CreateObject("Scripting.Dictionary") for i=lbound(arrBasket) to ubound(arrBasket) w.item(arrBasket(i)) = w.item(arrBasket(i))+1 next for each word in w response.write word & " occurs " & w(word) & " times<br>" next
noget ala -- <% basket = "23,23,12,9,123,129,12,12,12" fundne = "" arrBasket = Split(basket,",") For t = LBound(arrBasket) To Ubound(arrBasket) strProd = arrBasket(t) If InStr(fundne&",",strProd&",") = 0 Then fundne = fundne &","&strProd strCount = 1 For l = LBound(arrBasket) To UBound(arrBasket) If int(arrBasket(l)) = int(strProd) Then strCount = strCount + 1 End if Next Response.Write strCount & " x " & arrBasket(t) & "<br />" End If Next %> -- Men eriks er ligeså godt
Jeg samler ikke på point, tak. Men du kan også få sorteret efter tallet:
basket = "23,23,12,9,123,129,12,12,12" arrBasket = Split(basket,",") set w = Server.CreateObject("Scripting.Dictionary") for i=lbound(arrBasket) to ubound(arrBasket) w.item(clng(arrBasket(i))) = w.item(clng(arrBasket(i)))+1 next a = w.keys() 'a is now an array of keys for i=ubound(a)-1 to lbound(a) step -1 for j=0 to i if a(j)>a(j+1) then tmp=a(j):a(j)=a(j+1):a(j+1)=tmp next next for i=lbound(a) to ubound(a) response.write a(i) & " = " & w(a(i)) & "<br>" next
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.