Felu
Veteran Member
Posts: 2223 Reputation: 72
30 / /
Joined: Apr 2006
Status: Away
|
RE: Random Selection
code: function RandomFile(Folder){//The Function
FileArray = new Array();//The Array
for(var e = new Enumerator(fso.GetFolder(Folder).Files); !e.atEnd(); e.moveNext())//The Enumerator
FileArray.push(e.item());//Push the files into the array
File = FileArray[Math.floor(Math.random()*FileArray.length)];//Getting a Random File
return File;//Return the random File
}
This post was edited on 02-04-2007 at 01:48 PM by Felu.
|
|