Changeset 335 for trunk/Include/com/currency.ab
- Timestamp:
- Sep 18, 2007, 12:10:41 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/com/currency.ab
r267 r335 28 28 End Sub 29 29 */ 30 /* 30 31 Const Function Operator +() As Currency 31 32 Return New Currency(This) 32 33 End Function 33 34 */ 34 35 Const Function Operator -() As Currency 35 36 Dim ret = New Currency … … 58 59 Const Function Operator /(y As Variant) As Double 59 60 Dim vx = New Variant(This) 60 Dim ret = vx / y61 Dim ret = vx / y 61 62 Return ret.ValR4 62 63 End Function 63 64 64 65 Const Function Operator /(y As Currency) As Double 65 Return This / New Varinat(y) 66 Dim vx = New Variant(This) 67 Dim vy = New Variant(y) 68 Dim ret = vx / vy 69 Return ret.ValR4 66 70 End Function 67 71 … … 79 83 80 84 Static Function Compare(x As Currency, y As Currency) As HRESULT 81 Return VarCyCmp(x ,y)85 Return VarCyCmp(x.cy, y.cy) 82 86 End Function 83 87 84 88 Static Function Compare(x As Currency, y As Double) As HRESULT 85 Return VarCyCmpR8(x , y)89 Return VarCyCmpR8(x.cy, y) 86 90 End Function 87 91 88 92 Static Function Compare(x As Double, y As Currency) As HRESULT 89 Dim ret = VarCyCmpR8(y , x)93 Dim ret = VarCyCmpR8(y.cy, x) 90 94 Select Case ret 91 95 Case VARCMP_LT … … 140 144 Const Function Operator <=(y As Currency) As Boolean 141 145 Dim c = Compare(This, y) 142 Return result = VARCMP_LT Or result= VARCMP_EQ146 Return c = VARCMP_LT Or c = VARCMP_EQ 143 147 End Function 144 148 145 149 Const Function Operator <=(y As Double) As Boolean 146 150 Dim c = Compare(This, y) 147 Return result = VARCMP_LT Or result= VARCMP_EQ151 Return c = VARCMP_LT Or c = VARCMP_EQ 148 152 End Function 149 153 150 154 Const Function Operator >=(y As Currency) As Boolean 151 155 Dim c = Compare(This, y) 152 Return result = VARCMP_GT Or result= VARCMP_EQ156 Return c = VARCMP_GT Or c = VARCMP_EQ 153 157 End Function 154 158 155 159 Const Function Operator >=(y As Double) As Boolean 156 160 Dim c = Compare(This, y) 157 Return result = VARCMP_GT Or result= VARCMP_EQ161 Return c = VARCMP_GT Or c = VARCMP_EQ 158 162 End Function 159 163
Note:
See TracChangeset
for help on using the changeset viewer.