HandleError Subroutine Example
The following example demonstrates how the HandleError subroutine would be used in trapping errors.
Public Function GetDecimalSeparator()
Dim intCountChar As Integer
Dim lngHolder As Long
Dim strDecChar As String
On Error GoTo ErrorHandler
'Set the buffer for the return value
strDecChar = Space$(255)
'Get the decimal separator and the count of characters for the thousand 'separator
lngHolder = GetLocaleInfoA(GetUserDefaultLCID(), LOCALE_SDECIMAL, strDecChar, Len(strDecChar) + 1)
'Now set the return value to just the decimal separator.
GetDecimalSeparator = Left$(strDecChar, lngHolder - 1)
Exit Function
ErrorHandler:
HandleError
End Function