Ignore:
Timestamp:
Nov 25, 2007, 4:31:35 PM (16 years ago)
Author:
イグトランス (egtra)
Message:

Stringなどで例外を投げるようにした。
#147の解決。
CType ASCII文字判定関数群の追加。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/system/exception.ab

    r375 r388  
    5757                End If
    5858            Else
    59                 If lstrcmp( paramName, ex.GetType().FullName ) = 0 Then
     59                If isCatchable(New String(paramName), ex.GetType()) Then
     60'               If lstrcmp( paramName, ex.GetType().FullName ) = 0 Then
    6061                    ' マッチしたとき
    6162                    Return codePos
     
    6465        Wend
    6566        Return defaultCatchCodePos
     67    End Function
     68
     69    Function isCatchable(paramName As String, catchType As System.TypeInfo) As Boolean
     70        isCatchable = False
     71        While Not ActiveBasic.IsNothing(catchType)
     72            Dim catchTypeName = catchType.FullName
     73            If paramName = catchTypeName Then
     74                isCatchable = True
     75                Exit Function
     76            End If
     77            catchType = catchType.BaseType
     78        Wend
    6679    End Function
    6780End Class
     
    114127
    115128            'TODO: 適切なエラー処理
    116             MessageBox( NULL, "例外", "", MB_OK or MB_ICONEXCLAMATION )
    117 
     129            MessageBox( NULL, "Catchされていない例外があります", NULL, MB_OK or MB_ICONEXCLAMATION )
     130            Debug
    118131            Return
    119132        End If
Note: See TracChangeset for help on using the changeset viewer.