Ignore:
Timestamp:
Apr 7, 2007, 10:20:40 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

[207]参照型変数のNothing初期化に対応する修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/com/currency.ab

    r200 r208  
    7171    End Function
    7272
     73    Static Function Compare(x As Currency, y As Currency) As HRESULT
     74        Return VarCyCmp(x, y)
     75    End Function
     76
     77    Static Function Compare(x As Currency, y As Double) As HRESULT
     78        Return VarCyCmpR8(x, y)
     79    End Function
     80
     81    Static Function Compare(x As Double, y As Currency) As HRESULT
     82        Dim ret = VarCyCmpR8(y, x)
     83        Select Case ret
     84            Case VARCMP_LT
     85                Return VARCMP_GT
     86            Case VARCMP_GT
     87                Return VARCMP_LT
     88            Case Else
     89                Return ret
     90        End Select
     91    End Function
     92
     93    Const Function Operator ==(y As Currency) As Boolean
     94        Dim c = Compare(This, y)
     95        Return c = VARCMP_EQ
     96    End Function
     97
     98    Const Function Operator ==(y As Double) As Boolean
     99        Dim c = Compare(This, y)
     100        Return c = VARCMP_EQ
     101    End Function
     102
     103    Const Function Operator <>(y As Currency) As Boolean
     104        Dim c = Compare(This, y)
     105        Return c <> VARCMP_EQ
     106    End Function
     107
     108    Const Function Operator <>(y As Double) As Boolean
     109        Dim c = Compare(This, y)
     110        Return c <> VARCMP_EQ
     111    End Function
     112
     113    Const Function Operator <(y As Currency) As Boolean
     114        Dim c = Compare(This, y)
     115        Return c = VARCMP_LT
     116    End Function
     117
     118    Const Function Operator <(y As Double) As Boolean
     119        Dim c = Compare(This, y)
     120        Return c = VARCMP_LT
     121    End Function
     122/*
     123    Const Function Operator >(y As Currency) As Boolean
     124        Dim c = Compare(This, y)
     125        Return c = VARCMP_GT
     126    End Function
     127
     128    Const Function Operator >(y As Double) As Boolean
     129        Dim c = Compare(This, y)
     130        Return c = VARCMP_GT
     131    End Function
     132*/
     133    Const Function Operator <=(y As Currency) As Boolean
     134        Dim c = Compare(This, y)
     135        Return result = VARCMP_LT Or result = VARCMP_EQ
     136    End Function
     137
     138    Const Function Operator <=(y As Double) As Boolean
     139        Dim c = Compare(This, y)
     140        Return result = VARCMP_LT Or result = VARCMP_EQ
     141    End Function
     142
     143    Const Function Operator >=(y As Currency) As Boolean
     144        Dim c = Compare(This, y)
     145        Return result = VARCMP_GT Or result = VARCMP_EQ
     146    End Function
     147
     148    Const Function Operator >=(y As Double) As Boolean
     149        Dim c = Compare(This, y)
     150        Return result = VARCMP_GT Or result = VARCMP_EQ
     151    End Function
     152
    73153    Const Function Abs() As Currency
     154        Abs = New Currency
    74155        VarCyAbs(This.cy, Abs.cy)
    75156    End Function
    76157
    77158    Const Function Fix() As Currency
     159        Fix = New Currency
    78160        VarCyFix(This.cy, Fix.cy)
    79161    End Function
    80162
    81163    Const Function Int() As Currency
     164        Int = New Currency
    82165        VarCyInt(This.cy, Int.cy)
    83166    End Function
    84167
    85168    Const Function Round(c = 0 As Long) As Currency
     169        Round = New Currency
    86170        VarCyRound(This.cy, c, Round.cy)
    87171    End Function
Note: See TracChangeset for help on using the changeset viewer.