Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Random Advertising Shuffle

QUESTION:

Anybody have any sample code on how to go about making a random image/link "banner" a la Yahoo-style? If I can get webbatch to do this, I will actually buy the product. If not, I will just continue to pull my hair out while waiting for the real world to become java-enabled....

Here's an example


	;Randomad.web


	WhereAds="C:\MYADS\"
	ListofAds=FileItemize(strcat(WhereAds,"*.gif")
	CountOfAds=ItemCount(ListOfAds,@tab)
	RandAd=Random(CountOfAds-1)+1
	TheAd=ItemExtract(RandAd,ListOfAds,@tab)
	WebOut('Content-type: image/gif', 2)
	WebOutFile(strcat(WhereAds,TheAd))
	exit


Article ID:   W12472
Filename:   Random Ads Shuffle Sample.txt