using “on error resume next” in classic ASP, and how to handle errors

前端 未结 3 2102
清歌不尽
清歌不尽 2021-02-14 03:49

Good day all, I would like to ask a thing about on error resume next

let\'s assume we have a loop to navigate through a recordset like:

Do w         


        
3条回答
  •  野性不改
    2021-02-14 04:24

    on error resume next statement just only ignore the current line error and send the program control to the next line.

    on error goto 0 just stops the working of on error resume next.That's it.

    <%
    on error resume next
    response.write(1/0)
    if err.number <> 0 then
    response.write("" & "err= "&"")
    response.write(err.description)
    response.write("" & " err number= "&"" )
    response.write(err.number&"
    ") end if 'after this statement ASP will no longer resume the error and program terminate at here if error occur after this line on error goto 0 response.write(6/0) %>

提交回复
热议问题