Ignore:
Timestamp:
Nov 17, 2007, 9:34:36 AM (17 years ago)
Author:
イグトランス (egtra)
Message:

SPrintf関数の実装

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/Classes/ActiveBasic/Strings/Strings.ab

    r370 r383  
    1111
    1212Sub ChrFill(p As PWSTR, n As SIZE_T, c As WCHAR)
    13     Dim i As SIZE_T
    14     For i = 0 To ELM(n)
     13    Dim i = 0 As SIZE_T
     14    While i <> n
    1515        p[i] = c
    16     Next
     16        i++
     17    Wend
    1718End Sub
    1819
    1920Sub ChrFill(p As PSTR, n As SIZE_T, c As SByte)
    20     Dim i As SIZE_T
    21     For i = 0 To ELM(n)
     21    Dim i = 0 As SIZE_T
     22    While i <> n
    2223        p[i] = c
    23     Next
     24        i++
     25    Wend
    2426End Sub
    2527
     
    105107
    106108Function ChrPBrk(str As PCWSTR, cStr As SIZE_T, chars As PCWSTR, cChars As SIZE_T) As SIZE_T
    107     Dim i As SIZE_T
    108     For i = 0 To ELM(cStr)
     109    Dim i = 0 As SIZE_T
     110    While i <> cStr
    109111        If ChrFind(chars, cChars, str[i]) <> -1 Then
    110112            Return i
    111113        End If
    112     Next
     114        i++
     115    Wend
    113116    Return -1 As SIZE_T
    114117End Function
    115118
    116119Function ChrPBrk(str As PCSTR, cStr As SIZE_T, Chars As PCSTR, cChars As SIZE_T) As SIZE_T
    117     Dim i As SIZE_T
    118     For i = 0 To ELM(cStr)
     120    Dim i = 0 As SIZE_T
     121    While i <> cStr
    119122        If ChrFind(Chars, cChars, str[i]) <> -1 Then
    120123            Return i
    121124        End If
    122     Next
     125        i++
     126    Wend
    123127    Return -1 As SIZE_T
    124128End Function
    125129
    126130Function ChrFind(s As PCWSTR, size As SIZE_T, c As WCHAR) As SIZE_T
    127     Dim i As SIZE_T
    128     For i = 0 To ELM(size)
     131    Dim i = 0 As SIZE_T
     132    While i <> size
    129133        If s[i] = c Then
    130134            Return i
    131135        End If
    132     Next
     136        i++
     137    Wend
    133138    Return -1 As SIZE_T
    134139End Function
    135140
    136141Function ChrFind(s As PCSTR, size As SIZE_T, c As CHAR) As SIZE_T
    137     Dim i As SIZE_T
    138     For i = 0 To ELM(size)
     142    Dim i = 0 As SIZE_T
     143    While i <> size
    139144        If s[i] = c Then
    140145            Return i
    141146        End If
    142     Next
     147        i++
     148    Wend
    143149    Return -1 As SIZE_T
    144150End Function
     
    210216    Loop
    211217End Function
     218
    212219End Namespace 'Detail
    213220
Note: See TracChangeset for help on using the changeset viewer.