Hi,
Yes, it is not random but "pseudorandom", it returns the same sequence
every time REBOL is run. Try to seed it with current time before use:
random/seed now
ad: random 6
--
Michal Kracik
[EMAIL PROTECTED] wrote:
>
> Thanks for the help so far. I have one last problem. The following
> script works fine now (having moved the Content-Type statement to just
> before the print output statement) except that it doesn't print a
> random banner like I expect it to. It always prints the 3rd banner,
> even though the pick number is set by using...
>
> ad: random 6
>
> ...I tried giving "ad" a different value following the print statement,
> but it seems to have gotten caught up with the value "3" and I never
> see any other banner except the 3rd choice. The script should execute
> every time I reload the page, right?
>
> #!rebol -cs
>
> REBOL [
> Title: "Banner Ad Randomizer"
> File: %webbanner.cgi
> Date: 16-Apr-2000
> Author: "Ryan Christiansen"
> Purpose: {
> Generate HTML code that displays a linked banner advertisement
> }
> ]
>
> urls: [ "http://www.schonder.com"
> "http://www.schonder.com"
> "http://www.abisoft.com/BePlan/PurchaseBOSJ.html"
> "http://www.lebuzz.com/buzzcd_ad.html"
> "http://www.pushove.com/beos/"
> "http://www.bebits.com/app/867"
> ]
>
> imgs: [ "schonder.gif"
> "schnondersource.gif"
> "BePlan.gif"
> "buzzcd_anim.gif"
> "nvf.gif"
> "ImageProAd.gif"
> ]
>
> alts: [ "Papier-Schonder KG office supply and bookstore"
> "Papier-Schonder KG office supply and bookstore"
> "BePlan from AbiSoft"
> "BuzzCD - Hand-picked best BeOS software"
> "NVF: A Be-centric comic strip"
> "ImagePro displays, zooms, and re-sizes images"
> ]
>
> ad: random 6
>
> url: pick urls ad
> img: pick imgs ad
> alt: pick alts ad
>
> print "Content-Type: text/html^/"
>
> print rejoin [{<a href="} url {"><IMG SRC="/graphics/bannerads/} img {"
> ALT="} alt {" target="_blank" border=0></a>}]