Changeset 335


Ignore:
Timestamp:
Sep 18, 2007, 12:10:41 AM (17 years ago)
Author:
イグトランス (egtra)
Message:

SPrintF関連の追加。関数FloatToChars, FormatFloatE, FormatIntegerUと列挙体FormatFlags。

Location:
trunk
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/Classes/ActiveBasic/Windows/CriticalSection.ab

    r303 r335  
    5353
    5454    /*Override*/ Sub Dispose()
    55 '       Dim p = ActiveBasic.Windows.Detail.InterlockedExchangeAnyPointer(pcs, 0)
    56         Dim p = InterlockedExchangePointer(pcs As VoidPtr, 0) As *CRITICAL_SECTION
    57         If p <> 0 Then
    58             LeaveCriticalSection(ByVal p)
     55'       Dim pcsOld = ActiveBasic.Windows.Detail.InterlockedExchangeAnyPointer(pcs, 0)
     56        Dim pcsOld = InterlockedExchangePointer(pcs As VoidPtr, 0) As *CRITICAL_SECTION
     57        If pcsOld <> 0 Then
     58            LeaveCriticalSection(ByVal pcsOld)
    5959        End If
    6060    End Sub
  • trunk/Include/Classes/ActiveBasic/index.ab

    r275 r335  
    11#require "./Core/index.ab"
     2#require "./Windows/index.ab"
  • trunk/Include/Classes/System/Diagnostics/TraceListener.ab

    r291 r335  
    141141                ' デバッグビューへ出力
    142142                Dim tempStr = GetIndentString() + message
    143                 OutputDebugString( tempStr )
     143                OutputDebugString( ToTCStr(tempStr) )
    144144
    145145                ' デバッグログへ書き込む
  • trunk/Include/Classes/System/Drawing/Color.ab

    r303 r335  
    44#define __SYSTEM_DRAWING_COLOR_AB__
    55
    6 #include <Classes/System/Math.ab>
     6'#include <Classes/System/Math.ab>
    77#include <Classes/System/Drawing/Imaging/misc.ab>
    88
     
    7676        ToCOLORREF = RGB(R, G, B)
    7777    End Function
    78 
     78/*
    7979    Function ToArgb() As ARGB
    80         Return argb
    81     End Function
    82 
     80        ToArgb = argb
     81    End Function
     82*/
    8383    Static Function FromArgb(argb As ARGB) As Color
    8484        Return New Color(argb)
  • trunk/Include/Classes/System/Drawing/Rectangle.ab

    r303 r335  
    44#define __SYSTEM_DRAWING_RECTANGLE_AB__
    55
    6 #require <Classes/System/Math.ab>
     6'#require <Classes/System/Math.ab>
    77#require <Classes/System/Drawing/RectangleF.ab>
    88#require <Classes/System/Drawing/Point.ab>
  • trunk/Include/Classes/System/Drawing/RectangleF.ab

    r303 r335  
    44#define __SYSTEM_DRAWING_RECTANGLEF_AB__
    55
    6 #include <Classes/System/Math.ab>
     6'#include <Classes/System/Math.ab>
    77#include <Classes/System/Drawing/PointF.ab>
    88#include <Classes/System/Drawing/SizeF.ab>
  • trunk/Include/Classes/System/Drawing/Size.ab

    r303 r335  
    44#define __SYSTEM_DRAWING_SIZE_AB__
    55
    6 #include <Classes/System/Math.ab>
     6'#include <Classes/System/Math.ab>
    77#include <Classes/System/Drawing/SizeF.ab>
    88
  • trunk/Include/com/bstring.ab

    r272 r335  
    11' com/bstring.ab
    22
    3 #require <ole2.ab>
    4 #require <oleauto.ab>
     3'#require <ole2.ab>
     4'#require <oleauto.ab>
    55
    66Namespace ActiveBasic
     
    1919
    2020    Sub BString(s As BString)
    21         Init(s.bs, s.Length)
     21        BString.Copy(This.bs, s.bs)
    2222    End Sub
    2323
     
    5050    Sub Assign(bstr As BString)
    5151        Clear()
    52         Init(bstr, bstr.Length)
     52        BString.Copy(This.bs, bstr.bs)
    5353    End Sub
    5454
    5555    Sub Assign(s As LPCOLESTR)
    5656        Clear()
    57         Init(s, lstrlenW(s))
     57        s = SysAllocString(s)
    5858    End Sub
    5959
    6060    Sub AssignFromBStr(bstr As BSTR)
    6161        Clear()
    62         String.Copy(bs, bstr)
     62        BString.Copy(bs, bstr)
    6363    End Sub
    6464
  • trunk/Include/com/currency.ab

    r267 r335  
    2828    End Sub
    2929*/
     30/*
    3031    Const Function Operator +() As Currency
    3132        Return New Currency(This)
    3233    End Function
    33 
     34*/
    3435    Const Function Operator -() As Currency
    3536        Dim ret = New Currency
     
    5859    Const Function Operator /(y As Variant) As Double
    5960        Dim vx = New Variant(This)
    60         Dim ret= vx / y
     61        Dim ret = vx / y
    6162        Return ret.ValR4
    6263    End Function
    6364
    6465    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
    6670    End Function
    6771
     
    7983
    8084    Static Function Compare(x As Currency, y As Currency) As HRESULT
    81         Return VarCyCmp(x, y)
     85        Return VarCyCmp(x.cy, y.cy)
    8286    End Function
    8387
    8488    Static Function Compare(x As Currency, y As Double) As HRESULT
    85         Return VarCyCmpR8(x, y)
     89        Return VarCyCmpR8(x.cy, y)
    8690    End Function
    8791
    8892    Static Function Compare(x As Double, y As Currency) As HRESULT
    89         Dim ret = VarCyCmpR8(y, x)
     93        Dim ret = VarCyCmpR8(y.cy, x)
    9094        Select Case ret
    9195            Case VARCMP_LT
     
    140144    Const Function Operator <=(y As Currency) As Boolean
    141145        Dim c = Compare(This, y)
    142         Return result = VARCMP_LT Or result = VARCMP_EQ
     146        Return c = VARCMP_LT Or c = VARCMP_EQ
    143147    End Function
    144148
    145149    Const Function Operator <=(y As Double) As Boolean
    146150        Dim c = Compare(This, y)
    147         Return result = VARCMP_LT Or result = VARCMP_EQ
     151        Return c = VARCMP_LT Or c = VARCMP_EQ
    148152    End Function
    149153
    150154    Const Function Operator >=(y As Currency) As Boolean
    151155        Dim c = Compare(This, y)
    152         Return result = VARCMP_GT Or result = VARCMP_EQ
     156        Return c = VARCMP_GT Or c = VARCMP_EQ
    153157    End Function
    154158
    155159    Const Function Operator >=(y As Double) As Boolean
    156160        Dim c = Compare(This, y)
    157         Return result = VARCMP_GT Or result = VARCMP_EQ
     161        Return c = VARCMP_GT Or c = VARCMP_EQ
    158162    End Function
    159163
  • trunk/Include/com/decimal.ab

    r267 r335  
    11' com/decimal.ab
    22
    3 #require <oleauto.ab>
     3'#require <oleauto.ab>
    44#require <com/variant.ab>
    55#require <com/currency.ab>
     
    1414
    1515    Sub Decimal(d As Decimal)
    16         dec = d
     16'       dec = d なぜかコンパイルできない
     17        memcpy(VarPtr(dec), VarPtr(d), Len(dec))
    1718    End Sub
    1819
     
    5657        VarDecFromR8(x, dec)
    5758    End Sub
    58 
     59/*
    5960    Const Function Operator() As Variant
    6061        Return New Variant(This)
     
    195196    End Function
    196197*/
     198/*
    197199    Const Function Operator +() As Decimal
    198200        Return New Decimal(dec)
    199201    End Function
    200 
     202*/
    201203    Const Function Operator -() As Decimal
    202204        Dim ret = New Decimal
     
    211213    End Function
    212214
    213     Const Function Operator *(y As Long) As Decimal
    214         Dim ret = New Decimal
    215         VarDecMulI4(This.dec, y, ret.dec)
    216         Return ret
    217     End Function
    218 
    219     Const Function Operator *(y As Int64) As Decimal
    220         Dim ret = New Decimal
    221         VarDecMulI8(This.dec, y, ret.dec)
    222         Return ret
    223     End Function
    224 
    225215    Const Function Operator /(y As Decimal) As Decimal
    226216        Dim ret = New Decimal
     
    242232
    243233    Static Function Compare(x As Decimal, y As Decimal) As HRESULT
    244         Return VarDecCmp(x, y)
     234        Return VarDecCmp(x.dec, y.dec)
    245235    End Function
    246236
    247237    Static Function Compare(x As Decimal, y As Double) As HRESULT
    248         Return VarDecCmpR8(x, y)
     238        Return VarDecCmpR8(x.dec, y)
    249239    End Function
    250240
    251241    Static Function Compare(x As Double, y As Decimal) As HRESULT
    252         Dim ret = VarDecCmpR8(y, x)
     242        Dim ret = VarDecCmpR8(y.dec, x)
    253243        Select Case ret
    254244            Case VARCMP_LT
     
    303293    Const Function Operator <=(y As Decimal) As Boolean
    304294        Dim c = Compare(This, y)
    305         Return result = VARCMP_LT Or result = VARCMP_EQ
     295        Return c = VARCMP_LT Or c = VARCMP_EQ
    306296    End Function
    307297
    308298    Const Function Operator <=(y As Double) As Boolean
    309299        Dim c = Compare(This, y)
    310         Return result = VARCMP_LT Or result = VARCMP_EQ
     300        Return c = VARCMP_LT Or c = VARCMP_EQ
    311301    End Function
    312302
    313303    Const Function Operator >=(y As Decimal) As Boolean
    314304        Dim c = Compare(This, y)
    315         Return result = VARCMP_GT Or result = VARCMP_EQ
     305        Return c = VARCMP_GT Or c = VARCMP_EQ
    316306    End Function
    317307
    318308    Const Function Operator >=(y As Double) As Boolean
    319309        Dim c = Compare(This, y)
    320         Return result = VARCMP_GT Or result = VARCMP_EQ
     310        Return c = VARCMP_GT Or c = VARCMP_EQ
    321311    End Function
    322312
  • trunk/Include/com/variant.ab

    r267 r335  
    44#define _COM_VARIANT_AB
    55
    6 #require <oaidl.ab>
    7 #require <oleauto.ab>
     6'#require <oaidl.ab>
     7'#require <oleauto.ab>
    88#require <com/index.ab>
    99
     
    127127        v.vt = VT_EMPTY
    128128    End Sub
    129 
     129/*
    130130    Sub Operator =(y As Variant)
    131131        Assign(y.v)
     
    135135        Assign(y)
    136136    End Sub
    137 
     137*/
    138138    Sub Assign(from As Variant)
    139139        Assign(from.v)
     
    202202    Const Function Operator \(y As Variant) As Variant
    203203        Dim ret = New Variant
    204         VarIDiv(This.v, y.v, ret.v)
     204        VarIdiv(This.v, y.v, ret.v)
    205205        Return ret
    206206    End Function
     
    340340    Const Function Operator <=(y As Variant) As Boolean
    341341        Dim c = Compare(This, y)
    342         If result = VARCMP_LT Or result = VARCMP_EQ Then
     342        If c = VARCMP_LT Or c = VARCMP_EQ Then
    343343            Return True
    344344        Else
     
    349349    Const Function Operator >=(y As Variant) As Boolean
    350350        Dim c = Compare(This, y)
    351         If result = VARCMP_GT Or result = VARCMP_EQ Then
     351        If c = VARCMP_GT Or c = VARCMP_EQ Then
    352352            Return True
    353353        Else
     
    391391    Const Function ValUI1() As Byte
    392392        Dim r = ChangeType(VT_UI1)
    393         Return GetByte(VarPtr(r.val))
     393        Return GetByte(VarPtr(r.v.val))
    394394    End Function
    395395
     
    402402    Const Function ValUI2() As Word
    403403        Dim r = ChangeType(VT_UI2)
    404         Return GetWord(VarPtr(r.val))
     404        Return GetWord(VarPtr(r.v.val))
    405405    End Function
    406406
     
    413413    Const Function ValUI4() As DWord
    414414        Dim r = ChangeType(VT_UI4)
    415         Return GetDWord(VarPtr(r.val))
     415        Return GetDWord(VarPtr(r.v.val))
    416416    End Function
    417417
     
    424424    Const Function ValUI8() As QWord
    425425        Dim r = ChangeType(VT_UI8)
    426         Return GetQWord(VarPtr(r.val))
     426        Return GetQWord(VarPtr(r.v.val))
    427427    End Function
    428428
     
    501501    Const Function ValBool() As VARIANT_BOOL
    502502        Dim r = ChangeType(VT_BOOL)
    503         Return GetWord(VarPtr(r.val))
     503        Return GetWord(VarPtr(r.v.val))
    504504    End Function
    505505
     
    557557    Sub ValUnknown(x As *IUnknown)
    558558        Clear()
    559         SetPointer(VarPtr(v.val), x.Copy())
     559        SetPointer(VarPtr(v.val), x)
    560560        x->AddRef()
    561561        v.vt = VT_UNKNOWN
  • trunk/Include/com/vbobject.ab

    r267 r335  
    165165    End Function
    166166
    167     Sub Prop(ByRef arg As Variant)
     167    Sub Prop(arg As Variant)
    168168        Prop(ByVal arg.PtrToVariant)
    169169    End Sub
     
    173173    End Sub
    174174
    175     Sub PropRef(ByRef arg As Variant)
    176         PropRef(arg.PtrToVariant)
     175    Sub PropRef(arg As Variant)
     176        PropRef(ByVal arg.PtrToVariant)
    177177    End Sub
    178178
     
    297297
    298298Function CreateObject(className As PCWSTR) As VBObject
    299     Return New VBObject(className)
     299    Return New VBObject(className, 0, CLSCTX_ALL)
    300300End Function
    301301
    302302Function CreateObject(className As String) As VBObject
    303     Return New VBObject(ToWCStr(className))
     303    Return New VBObject(ToWCStr(className), 0, CLSCTX_ALL)
    304304End Function
    305305/*
  • trunk/TestCase/SimpleTestCase/SimpleTestCase.idx

    r334 r335  
    2222#include "BlittableTest.ab"
    2323_ClearNamespaceImported
     24#include "SPrintFTest.ab"
     25_ClearNamespaceImported
     26
     27'リソースファイル
     28#include "resource.ab"
     29#resource "SimpleTestCase.rc"
  • trunk/TestCase/SimpleTestCase/SimpleTestCase.pj

    r334 r335  
    2323#DEBUG_EXE_PATH=
    2424
    25 #RESOURCE=0
     25#RESOURCE=SimpleTestCase.rc
    2626
    2727#SOURCE
     
    3636StringBuilderTest.ab
    3737BlittableTest.ab
     38SPrintFTest.ab
Note: See TracChangeset for help on using the changeset viewer.