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/currency.ab

    r355 r478  
    22
    33#require <com/variant.ab>
    4 
    5 #ifndef _COM_CURRENCY_AB
    6 #define _COM_CURRENCY_AB
    74
    85Namespace ActiveBasic
     
    5653        Return ret
    5754    End Function
    58 /*
     55
    5956    Const Function Operator /(y As Variant) As Double
    6057        Dim vx = New Variant(This)
     
    6966        Return ret.ValR8
    7067    End Function
    71 */
     68
    7269    Const Function Operator +(y As Currency) As Currency
    7370        Dim ret = New Currency
     
    131128        Return c = VARCMP_LT
    132129    End Function
    133 /*
     130
    134131    Const Function Operator >(y As Currency) As Boolean
    135132        Dim c = Compare(This, y)
     
    141138        Return c = VARCMP_GT
    142139    End Function
    143 */
     140
    144141    Const Function Operator <=(y As Currency) As Boolean
    145142        Dim c = Compare(This, y)
     
    183180
    184181    Const Function Cy() As CY
    185         Return cy
     182        Cy = cy
    186183    End Function
    187184
     
    203200
    204201    Override Function ToString() As String
    205         Dim bs As BSTR
    206         VarBstrFromCy(cy, LOCALE_USER_DEFAULT, LOCALE_USE_NLS, bs)
    207         ToString = New String(bs As PCWSTR, SysStringLen(bs) As Long)
    208         SysFreeString(bs)
     202        /*Using*/ Dim bstr = New BString
     203            Dim bs As BSTR
     204            VarBstrFromCy(cy, LOCALE_USER_DEFAULT, LOCALE_USE_NLS, bs)
     205            bstr.Attach(bs)
     206            ToString = bstr.ToString
     207        bstr.Dispose() 'End Using
    209208    End Function
    210209
     
    223222End Namespace 'COM
    224223End Namespace 'ActiveBasic
    225 
    226 #endif '_COM_CURRENCY_AB
Note: See TracChangeset for help on using the changeset viewer.