Bilgisayar Bölümü ASP Kod ve Script Arşivi

Random link

I got a mail from a developer who wanted To display
a list of links where the order where random. And it
puzzled Me For a While how To accomplish this. So
I started coding And soon I had this code:

'Make link Array
Dim LinkArray(4,2)

'Putting In the links into the Array
'If you want, you can read those links from
'a Text file Or a db. If you want more links, just
'increase the size of the Array
LinkArray(0,2)=""A cool ASP site:!""

LinkArray(1,2)=""Computer news from!""

LinkArray(2,2)=""Do you Yahoo?""

LinkArray(3,2)=""My favorite search engine: hotbot""

LinkArray(4,2)=""Visit Gamecenter""

NotChooseUsAgain = ""#""
For i=0 To UBound(LinkArray)
While Not OK
RandomVar = Int(Rnd * (UBound(LinkArray)+1))
If InStr(NotChooseUsAgain,""#"" & RandomVar & ""#"")=0
OK = True
NotChooseUsAgain = NotChooseUsAgain & RandomVar &
End If
<A HREF=""<%=LinkArray(RandomVar,1)%>"">
OK = False

It works, but Is there an easier way??
Please drop Me line With your opinion:
What you'd want the script For? I'm Not sure,
but it could be nice If you have a list of links
To all your friends On your page. Then they won't
be angry If their site wasn't at the top.


ASP Kitabı


Faydalılar: Altın Fiyatları |Hediye Kolye | pırlanta fiyatları
Ana Sayfa  Sık Kullanılanlara Ekle   admin[at] | © 2006 - 2022