N
nvyush
Создайте и выполните агента с нижеприведённым кодом. Первая функция сбрасывает ошибку, вторая — нет.на сколько я знаю - нет, не сброситься
<div class="sp-wrap"><div class="sp-head-wrap"><div class="sp-head folded clickable">Код агента</div></div><div class="sp-body"><div class="sp-content">
Код:
Sub Initialize
On Error Goto ErrorMsg
Print "" & Getthreadinfo(1) & " line " & Getthreadinfo(0) & " Err = " & Err & " Error = " & Error
Call testErr1
Print "" & Getthreadinfo(1) & " line " & Getthreadinfo(0) & " Err = " & Err & " Error = " & Error
Call testErr2
Print "" & Getthreadinfo(1) & " line " & Getthreadinfo(0) & " Err = " & Err & " Error = " & Error
Exit Sub
ErrorMsg:
Msgbox Error
Print "" & Getthreadinfo(1) & " line " & Getthreadinfo(0) & " Err = " & Err & " Error = " & Error
Exit Sub
End Sub
Sub testErr1
On Error Goto ErrorMsg
Print "" & Getthreadinfo(1) & " line " & Getthreadinfo(0) & " Err = " & Err & " Error = " & Error
Error 1000, "Some error"
ExitSub:
Print "" & Getthreadinfo(1) & " line " & Getthreadinfo(0) & " Err = " & Err & " Error = " & Error
Exit Sub
ErrorMsg:
Msgbox Error
Print "" & Getthreadinfo(1) & " line " & Getthreadinfo(0) & " Err = " & Err & " Error = " & Error
Resume ExitSub
End Sub
Sub testErr2
On Error Goto ErrorMsg
Print "" & Getthreadinfo(1) & " line " & Getthreadinfo(0) & " Err = " & Err & " Error = " & Error
Error 1000, "Some error"
ExitSub:
Print "" & Getthreadinfo(1) & " line " & Getthreadinfo(0) & " Err = " & Err & " Error = " & Error
Exit Sub
ErrorMsg:
Msgbox Error
Print "" & Getthreadinfo(1) & " line " & Getthreadinfo(0) & " Err = " & Err & " Error = " & Error
Exit Sub
End Sub