Changeset 478 for trunk/Include/com/decimal.ab
- Timestamp:
- Mar 13, 2008, 9:06:43 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/com/decimal.ab
r355 r478 1 1 ' com/decimal.ab 2 2 3 '#require <oleauto.ab>4 3 #require <com/variant.ab> 5 4 #require <com/currency.ab> … … 14 13 15 14 Sub Decimal(d As Decimal) 16 ' dec = d なぜかコンパイルできない 17 memcpy(VarPtr(dec), VarPtr(d.dec), Len(dec)) 15 dec = d.dec 18 16 End Sub 19 17 20 18 Sub Decimal(ByRef d As DECIMAL) 21 memcpy(VarPtr(dec), VarPtr(d), Len(dec))19 dec = d 22 20 End Sub 23 21 24 22 Sub Decimal(lo As Long, mid As Long, hi As Long, isNegative As Boolean, scale As Byte) 25 23 If scale > 28 Then 26 Debug 27 Throw New ArgumentOutOfRangeException 24 Throw New ArgumentOutOfRangeException("scale") 28 25 End If 29 26 Dim sign As Byte … … 284 281 Return c = VARCMP_LT 285 282 End Function 286 /* 283 287 284 Const Function Operator >(y As Decimal) As Boolean 288 285 Dim c = Compare(This, y) … … 294 291 Return c = VARCMP_GT 295 292 End Function 296 */ 293 297 294 Const Function Operator <=(y As Decimal) As Boolean 298 295 Dim c = Compare(This, y) … … 348 345 349 346 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 354 353 End Function 355 354
Note:
See TracChangeset
for help on using the changeset viewer.