Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loops and onError when file doesn't exist

Status
Not open for further replies.

Fingerprint

Programmer
Oct 21, 2002
35
GB
I've got a directory of files with double digit numeric names, and I want to loop through them all to add into a databinding object, but they're not sequential numbers (the file name is generated randomly).
I've been trying to make it ignore the error and move to the next number, but I keep getting 'System cannot find specified resource'.
I've never used the onError event handler before - so does anyone have any tips?
Here is my code:

Code:
function addData()
 {
 for (var i=50;i<100;i++)
  {
  var added = &quot;&quot;;
  added = i;
  added += &quot;.csv&quot;;
  added.onError = i++;
  document.tdcInfo.dataURL = &quot;&quot;;
  document.tdcInfo.dataURL = added;
  document.tdcInfo.reset();
  }
 }

Thanks for any help,

- fingerprint
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top