<< Prev        Next >>

ID : 6771

ErrMsg

Function

To return an error message.

Syntax

ErrMsg(error code)

Guaranteed Entry

Error code
Designate an error code by integer type data.

Return Value

Return an error message by string type data.

Description

An error message of a designated error code is returned by string type data.

Attention

A string "Undefined error" is returned when an undefined error code is designated.

Example

'!TITLE "Acquiring Error Message"
'Display a trapped error in message output

Sub Main
  On Error GoTo ErrHandler

  Dim aaa As Trans
  aaa = V( 10, 5, 5 ) 'An error with different data type occurs

  Exit Sub

ErrHandler:
  PrintDbg  "&h" & Hex( Err.Number ) & " : " & ErrMsg( Err.Number )
  Resume Next
  
End Sub

ID : 6771

<< Prev        Next >>