Ignore:
Timestamp:
Mar 13, 2008, 9:06:43 PM (16 years ago)
Author:
イグトランス (egtra)
Message:

現在向けに修正(参照型のポインタの排除など)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/com/decimal.ab

    r355 r478  
    11' com/decimal.ab
    22
    3 '#require <oleauto.ab>
    43#require <com/variant.ab>
    54#require <com/currency.ab>
     
    1413
    1514    Sub Decimal(d As Decimal)
    16 '       dec = d なぜかコンパイルできない
    17         memcpy(VarPtr(dec), VarPtr(d.dec), Len(dec))
     15        dec = d.dec
    1816    End Sub
    1917
    2018    Sub Decimal(ByRef d As DECIMAL)
    21         memcpy(VarPtr(dec), VarPtr(d), Len(dec))
     19        dec = d
    2220    End Sub
    2321
    2422    Sub Decimal(lo As Long, mid As Long, hi As Long, isNegative As Boolean, scale As Byte)
    2523        If scale > 28 Then
    26             Debug
    27             Throw New ArgumentOutOfRangeException
     24            Throw New ArgumentOutOfRangeException("scale")
    2825        End If
    2926        Dim sign As Byte
     
    284281        Return c = VARCMP_LT
    285282    End Function
    286 /*
     283
    287284    Const Function Operator >(y As Decimal) As Boolean
    288285        Dim c = Compare(This, y)
     
    294291        Return c = VARCMP_GT
    295292    End Function
    296 */
     293
    297294    Const Function Operator <=(y As Decimal) As Boolean
    298295        Dim c = Compare(This, y)
     
    348345
    349346    Override Function ToString() As String
    350         Dim bs As BSTR
    351         VarBstrFromDec(dec, LOCALE_USER_DEFAULT, LOCALE_USE_NLS, bs)
    352         ToString = New String(bs As PCWSTR, SysStringLen(bs) As Long)
    353         SysFreeString(bs)
     347        /*Using*/ Dim bstr = New BString
     348            Dim bs As BSTR
     349            VarBstrFromDec(dec, LOCALE_USER_DEFAULT, LOCALE_USE_NLS, bs)
     350            bstr.Attach(bs)
     351            ToString = bstr.ToString
     352        bstr.Dispose() 'End Using
    354353    End Function
    355354
Note: See TracChangeset for help on using the changeset viewer.