Ignore:
Timestamp:
Mar 28, 2008, 5:43:34 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

インクルードガードとその他不要な前処理定義などの削除

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/basic/function.sbp

    r457 r497  
    11'function.sbp
    2 
    3 
    4 #ifndef _INC_FUNCTION
    5 #define _INC_FUNCTION
    6 
    72
    83Const _System_PI = 3.14159265358979323846264
     
    105Const _System_SQRT2 = 1.41421356237309504880168872421
    116Const _System_Log_N = 7 As Long
    12 
    13 
    14 #require <Classes/System/Math.ab>
    15 #require <Classes/System/DateTime.ab>
    16 #require <Classes/System/Text/StringBuilder.ab>
    17 #require <Classes/ActiveBasic/Math/Math.ab>
    18 #require <Classes/ActiveBasic/Strings/Strings.ab>
    19 
    207
    218'------------- サポート関数の定義 -------------
     
    243230'------------
    244231
    245 Function Asc(buf As String) As StrChar
     232Function Asc(buf As String) As Char
    246233    Asc = buf[0]
    247234End Function
    248235
    249 Function Chr$(code As StrChar) As String
     236Function Chr$(code As Char) As String
    250237    Chr$ = New String(code, 1)
    251238End Function
    252239
    253 #ifndef __STRING_IS_NOT_UNICODE
     240#ifdef UNICODE
    254241Function AscW(s As String) As UCSCHAR
    255242    If String.IsNullOrEmpty(s) Then
     
    275262Function ChrW(c As UCSCHAR) As String
    276263    If c <= &hFFFF Then
    277         Return New String(c As StrChar, 1)
     264        Return New String(c As Char, 1)
    278265    ElseIf c <= &h10FFFF Then
    279266        c -= &h10000
     
    390377
    391378Function Space$(length As Long) As String
    392     Return New String(&h20 As StrChar, length)
    393 End Function
    394 
    395 Sub _ecvt_support(buf As *StrChar, count As Long, size As Long)
     379    Return New String(&h20 As Char, length)
     380End Function
     381
     382Sub _ecvt_support(buf As *Char, count As Long, size As Long)
    396383    Dim i As Long
    397384    If buf[count] = 9 Then
     
    410397End Sub
    411398
    412 Sub _ecvt(buffer As *StrChar, value As Double, count As Long, ByRef dec As Long, ByRef sign As Boolean)
     399Sub _ecvt(buffer As *Char, value As Double, count As Long, ByRef dec As Long, ByRef sign As Boolean)
    413400    Dim i As Long, i2 As Long
    414401
    415402    '値が0の場合
    416403    If value = 0 Then
    417         ActiveBasic.Strings.ChrFill(buffer, count As SIZE_T, &h30 As StrChar)
     404        ActiveBasic.Strings.ChrFill(buffer, count As SIZE_T, &h30 As Char)
    418405        buffer[count] = 0
    419406        dec = 0
     
    442429
    443430    For i = 0 To count - 1
    444         buffer[i] = Int(value) As StrChar
     431        buffer[i] = Int(value) As Char
    445432        value = (value-CDbl(Int(value))) * 10
    446433    Next
     
    471458    End If
    472459    Dim dec As Long, sign As Boolean
    473     Dim buffer[32] As StrChar, temp[15] As StrChar
     460    Dim buffer[32] As Char, temp[15] As Char
    474461    Dim i = 0 As Long
    475462
     
    585572End Function
    586573
    587 Function String$(n As Long, s As StrChar) As String
     574Function String$(n As Long, s As Char) As String
    588575    Return New String(s, n)
    589576End Function
    590        
     577
    591578#ifdef _AB4_COMPATIBILITY_STRING$_
    592579Function String$(n As Long, s As String) As String
     
    594581        'Throw ArgumentOutOfRangeException
    595582    End If
    596 
    597583    Dim buf = New System.Text.StringBuilder(s.Length * n)
    598584    Dim i As Long
    599     For i = 0 To n
     585    For i = 1 To n
    600586        buf.Append(s)
    601587    Next
     
    603589#else
    604590Function String$(n As Long, s As String) As String
     591    Dim c As Char
    605592    If String.IsNullOrEmpty(s) Then
    606         Return New String(0 As StrChar, n)
    607     Else
    608         Return New String(s[0], n)
    609     End If
     593        c = 0
     594    Else
     595        c = s[0]
     596    End If
     597    String$ = New String(c, n)
    610598End Function
    611599#endif
     
    613601Function Time$() As String
    614602    Dim time = System.DateTime.Now
    615 
    616603    Dim buf = New System.Text.StringBuilder(8)
    617 
    618604    'hour
    619605    If time.Hour < 10 Then
     
    640626End Function
    641627
    642 Function Val(buf As *StrChar) As Double
     628Function Val(buf As *Char) As Double
    643629    Dim i As Long, i2 As Long, i3 As Long, i4 As Long
    644630    Dim temporary As String
    645     Dim TempPtr As *StrChar
     631    Dim TempPtr As *Char
    646632    Dim dbl As Double
    647633    Dim i64data As Int64
     
    665651                If Not (0<=i3 And i3<=7) Then Exit While
    666652
    667                 TempPtr[i]=i3 As StrChar
     653                TempPtr[i]=i3 As Char
    668654                i++
    669655            Wend
     
    688674                End If
    689675
    690                 TempPtr[i]=i3 As StrChar
     676                TempPtr[i]=i3 As Char
    691677                i++
    692678            Wend
     
    703689    Else
    704690        '10進数
    705 #ifdef __STRING_IS_NOT_UNICODE
     691#ifdef UNICODE
     692        swscanf(buf,"%lf",VarPtr(Val))
     693#else
    706694        sscanf(buf,"%lf",VarPtr(Val))
    707 #else
    708         swscanf(buf,ToWCStr("%lf"),VarPtr(Val))
    709695#endif
    710696    End If
     
    981967
    982968Function _System_IsLowSurrogate(c As WCHAR) As Boolean
    983     Return &hDC00 <= c And c < &hE000 
     969    Return &hDC00 <= c And c < &hE000
    984970End Function
    985971
     
    1000986    _System_GetHashFromWordArray = hash As Long
    1001987End Function
    1002 
    1003 #endif '_INC_FUNCTION
Note: See TracChangeset for help on using the changeset viewer.