WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Examples

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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
File Created: 2002:09:30:15:00:24
Last Updated: 2002:09:30:15:00:24