Click to See Complete Forum and Search --> : JScript error handling
JSPro
January 29th, 2005, 01:14 PM
i have 1 quick question about JScript error handling.
i tried to learn how to use try...catch statement to do the job but i'm unsuccessfully doing in it. Hopefully, you can help me figure it out.
example of code
try{
fso.DeleteFile("e:\\junk\\*.*");
fso.DeleteFolder("e:\\junk\\*.*");} catch(e){}
i have problem running this code because of "permission denied" or "file is not exist" and the code stops right there.
how can I fix this problem.?
thank you
Dr. Script
January 29th, 2005, 03:18 PM
What does the error, e, throw back at you? (article (http://www.webreference.com/js/tips/020920.html))
JSPro
January 29th, 2005, 03:28 PM
What does the error, e, throw back at you? (article (http://www.webreference.com/js/tips/020920.html))
1-if i don't use try...catch statement, i will receive error message "permission is denied" or "can't find file" and the code stops there. If i use try...catch statement, no error message AND the code doesn't do anything.
i don't have any problem running in VBS by using on error resume next...on go to 0 if i write it in VBS.
i'm looking away to see my JScript works. Basically, i want jscript to move on to its next job if previous job doesn't execute it because there is no file exist (like on error resume next....on go to 0 thing in vbs. Do you know what i mean.?
2-I look at the link which you posted. is there a way that i can have a complete language reference of JScript.net??? if so, where i can get it.????
3-I have seen other use like "Internet.Application" in their scripts. I don't know where they get this "internet.application" thing because i don't see it mention in MS jscript language reference.
thank you
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.