Restituisce una stringa descrittiva associata a un errore.
Sintassi
object.Description
Argomenti:
Object: obbligatorio. Sempre l'oggetto Err.
Note
La proprietà Description è composta da una breve descrizione dell'errore. Se la proprietà Description non viene impostata e il valore di Number corrisponde a un errore di runtime BSL, viene restituita la stringa descrittiva associata all'errore.
Nell'esempio seguente viene illustrato l'uso del metodo Description.
Esempio 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
Esempio 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