Ignore:
Timestamp:
Nov 23, 2007, 11:39:44 AM (17 years ago)
Author:
dai
Message:

StrPtr内の判定ミスを修正。
SPrintFクラス内のx64に対するコードを修正。
ArrayListクラスのIListインターフェイス実装を一旦保留。
ListクラスにIEnumeratable、IEnumeratorインターフェイスを実装(まだ実装中…)。

File:
1 edited

Legend:

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

    r385 r386  
    12051205*/
    12061206Function SPrintf(format As String, params As *Object, n As SIZE_T) As String
    1207     Dim i = 0 As DWord
     1207    Dim i = 0 As SIZE_T
    12081208    Dim paramsCount = 0 As SIZE_T
    12091209    Dim fmt = StrPtr(format)
     
    12111211    Do
    12121212        Dim last = format.Length - (((fmt - StrPtr(format)) \ SizeOf (StrChar)) As LONG_PTR) As Long 'po
    1213         Dim pos = ActiveBasic.Strings.ChrFind(fmt, last, &h25 As StrChar) '&h25 = %
     1213        Dim pos = ActiveBasic.Strings.ChrFind(fmt, last, &h25 As StrChar) As Long '&h25 = %
    12141214        If pos = -1 Then
    12151215            s.Append(fmt, 0, last)
     
    12701270                s.Append(FormatString(params[i] As String, precision, fieldWidth, flags))
    12711271            Case &h63 'c
    1272                 s.Append(FormatCharacter(params[i] As BoxedStrChar, precision, fieldWidth, flags))
     1272                s.Append(FormatCharacter(params[i] As BoxedStrChar, precision, fieldWidth, flags) As Char)
    12731273'           Case &h6e 'n
    12741274            Case &h25 '%
     
    12991299    param4 As Object, param5 As Object, param6 As Object,
    13001300    param7 As Object, param8 As Object, param9 As Object) As String
    1301 #ifdef _WIN64
    1302     'コンパイラがどういうコードを吐くのかわからないので、安全策を取る。
    1303     Dim params[9] = [param0, param1, param2, param3, param4,
    1304         param5, param6, param7, param8, param9] As Object
    1305 #else
     1301
    13061302    Dim params = VarPtr(param0) As *Object
    1307 #endif
     1303
    13081304    SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 10)
    13091305End Function
     
    13211317    param4 As Object, param5 As Object, param6 As Object,
    13221318    param7 As Object, param8 As Object) As String
    1323 #ifdef _WIN64
    1324     Dim params[8] = [param0, param1, param2, param3, param4,
    1325         param5, param6, param7, param8] As Object
    1326 #else
     1319
    13271320    Dim params = VarPtr(param0) As *Object
    1328 #endif
     1321
    13291322    SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 9)
    13301323End Function
     
    13421335    param4 As Object, param5 As Object, param6 As Object,
    13431336    param7 As Object) As String
    1344 #ifdef _WIN64
    1345     Dim params[7] = [param0, param1, param2, param3, param4,
    1346         param5, param6, param7] As Object
    1347 #else
     1337
    13481338    Dim params = VarPtr(param0) As *Object
    1349 #endif
     1339
    13501340    SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 8)
    13511341End Function
     
    13621352    param1 As Object, param2 As Object, param3 As Object,
    13631353    param4 As Object, param5 As Object, param6 As Object) As String
    1364 #ifdef _WIN64
    1365     Dim params[6] = [param0, param1, param2, param3, param4,
    1366         param5, param6] As Object
    1367 #else
     1354
    13681355    Dim params = VarPtr(param0) As *Object
    1369 #endif
     1356
    13701357    SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 7)
    13711358End Function
     
    13821369    param1 As Object, param2 As Object, param3 As Object,
    13831370    param4 As Object, param5 As Object) As String
    1384 #ifdef _WIN64
    1385     Dim params[5] = [param0, param1, param2, param3, param4,
    1386         param5] As Object
    1387 #else
     1371
    13881372    Dim params = VarPtr(param0) As *Object
    1389 #endif
     1373
    13901374    SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 6)
    13911375End Function
     
    14021386    param1 As Object, param2 As Object, param3 As Object,
    14031387    param4 As Object) As String
    1404 #ifdef _WIN64
    1405     Dim params[4] = [param0, param1, param2, param3, param4] As Object
    1406 #else
     1388
    14071389    Dim params = VarPtr(param0) As *Object
    1408 #endif
     1390
    14091391    SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 5)
    14101392End Function
     
    14201402Function SPrintf(format As String, param0 As Object,
    14211403    param1 As Object, param2 As Object, param3 As Object) As String
    1422 #ifdef _WIN64
    1423     Dim params[3] = [param0, param1, param2, param3] As Object
    1424 #else
     1404
    14251405    Dim params = VarPtr(param0) As *Object
    1426 #endif
     1406
    14271407    SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 4)
    14281408End Function
     
    14381418Function SPrintf(format As String, param0 As Object,
    14391419    param1 As Object, param2 As Object) As String
    1440 #ifdef _WIN64
    1441     Dim params[2] = [param0, param1, param2] As Object
    1442 #else
     1420
    14431421    Dim params = VarPtr(param0) As *Object
    1444 #endif
     1422
    14451423    SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 3)
    14461424End Function
     
    14561434Function SPrintf(format As String, param0 As Object,
    14571435    param1 As Object) As String
    1458 #ifdef _WIN64
    1459     Dim params[1] = [param0, param1] As Object
    1460 #else
     1436
    14611437    Dim params = VarPtr(param0) As *Object
    1462 #endif
     1438
    14631439    SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 2)
    14641440End Function
Note: See TracChangeset for help on using the changeset viewer.