in asp si può usare un on error?
tipo:
on error
resume next
Response.write(...)
end
in asp si può usare un on error?
tipo:
on error
resume next
Response.write(...)
end
si può usare "on error resume next"
non si può anche stampare qualcosa quando c'è l'errore?
Certo , devi testare l'oggetto ERR , in particolare il metodo :
Err.Number che risulta maggiore di zero nel caso in cui ce stato un errore
Per esempio :
if err.number > 0 then
response.write "error"
end if
![]()
Certo!
L'osservazione di eros era riferita al fatto che quella riga si scrive tutta su unica riga, mentre tu hai aperto il 3d portandola a capo.
ES:
codice:on error resume next ... ... ... if err.number <> 0 then response.write("Il tipo di errore riscontrato è: " & err.Description) end if
Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!
ricordati di Err.Clear alla fine, altrimenti potresti trascinarti l'errore anche in altri pezzi di codice.