<< Prev        Next >>

ID : 106

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 : 106

<< Prev        Next >>