Description 메소드

오류와 연계된 설명 문자열을 반환합니다.

구문

object.Description

인수:

Object: 필수.항상 Err 객체입니다.

주석

Description 등록정보는 오류에 대한 간단한 설명으로 구성됩니다. Description이 입력되지 않고 Number의 값이 BSL 런타임 오류에 해당하는 경우 오류와 연계된 설명 문자열이 반환됩니다.

다음 예에서는 description 메소드의 사용을 보여 줍니다.

예 1:

Sub RaiseOverflowError()
    On Error Resume Next          ' Enable error handling.
    Err.Raise 6                   ' Raise an overflow error.
    Output = "Error # " & Err.Number & ": " & Err.Description
    Err.Clear                     ' Clear the error.
End Sub
'Output: Error # 6: Overflow

예 2:

Sub RaiseMultipleErrors()
    On Error Resume Next          ' Enable error handling.
    ' Raise a "Type Mismatch" error.
    Err.Raise 13
    Output1 = "Error # " & Err.Number & ": " & Err.Description

    Err.Clear                     ' Clear the error.
    ' Raise a "Division by Zero" error.
    Err.Raise 11
    Output2 = "Error # " & Err.Number & ": " & Err.Description

    Err.Clear                     ' Clear the error.
End Sub
'Output1: Error # 13: Type mismatch 
'Output2: Error # 11: Division by zero