函数形式:Private Function ModifyFile(srcFile As String, Range As Long) As String
          srcFile:全路径长文件名,形式如:D:\BT\海贼王74.rmvb;
          Range任意整数(不考虑溢出)
目    的:将srcFile的文件名累加(减),幅度为Range,如
          srcFile = "D:\BT\海贼王74.rmvb";Range = 1 则返回:D:\BT\海贼王75.rmvb
          srcFile = "D:\BT\海贼王74.rmvb";Range =-1 则返回:D:\BT\海贼王73.rmvb
要    求:1、用vb6编写
          2、尽量不使用判断语句(可选,但这样比较有趣)
说    明:1、本来不想写成擂台的,纯粹是为了吸引观众,所以不要BS我;
          2、稍后贴出测试条件,即srcFile、Range 的值
          3、稍后再稍后贴出本人的答案,仅供参考
          4、本人的理解:编出容易,编好南,敬请高手指点!

解决方案 »

  1.   

    Private Function ModifyFile(srcFile As String, Range As Long) As String    Dim tmp As Integer, ipos As Integer
        Dim NoLength As Integer
        
        Dim Extension As String, tmpName As String
        
        ipos = InStrRev(srcFile, ".")  '---"."的位置
        
        Extension = Right(srcFile, Len(srcFile) - ipos) '---扩展名
        
        NoLength = Len(CStr(Val(StrReverse(Left(srcFile, ipos - 1)))))   '---路径中数字长度
        
        tmpName = Left(srcFile, ipos - 1 - NoLength)   '---除去扩展名和数字的路径
        
        tmp = Val(StrReverse(CStr(Val(StrReverse(Left(srcFile, ipos - 1)))))) + Range   '---加上Range后的数字
        
        ModifyFile = tmpName & CStr(tmp) & Extension   '---最终全路径长文件名
        
        '---呵呵没用判断语句,
        
        '---让高手见笑了
    End Function
      

  2.   

    惨了,
    最后一句忘了"."ModifyFile = tmpName & CStr(tmp) & Extension   '---最终全路径长文件名改为 ModifyFile = tmpName & CStr(tmp) & "." & Extension   '---最终全路径长文件名
      

  3.   

    To:colorslife(霜水茶) 再考虑一下吧,还很不完整!
      

  4.   

    To:colorslife(霜水茶) 
    srcFile = "D:\BT\海贼王70.rmvb 就不行了
      

  5.   

    Private Function ModifyFile( srcFile As String,  Range As Integer) As String    Dim ipos As Integer, iStart As Integer
        Dim Extension As String
        Dim FileName As String, HalfName As String
        Dim tmpNo As String, No As String
        
        ipos = InStrRev(srcFile, ".")
        
        Extension = Right(srcFile, Len(srcFile) - ipos)
        
        FileName = Left(srcFile, ipos - 1)
        
        tmpNo = StrReverse(CStr(Val(StrReverse(FileName))))
        
        iStart = InStrRev(srcFile, tmpNo)
        
        HalfName = Left(srcFile, iStart - 1)
        No = Mid(FileName, iStart)
        
        ModifyFile = HalfName & CStr(Val(No) + Range) & "." & Extension
    End Function----
    看看还有什么没考虑到啊,
      

  6.   

    To:colorslife(霜水茶) 再考虑一下吧! 这次不提示了,我去打球,大概21点回,到时你应该有灵感了,祝你好运!
      

  7.   

    To:colorslife(霜水茶) 如果你有兴趣,不妨试试少定义几个变量!
      

  8.   

    是没有,但是会更有趣,程序结构也更严谨,一点个人意见你没有考虑 srcFile = D:\BT\海贼王07.rmvb 的情况
      

  9.   

    Private Function ModifyFile(srcFile As String, Range As Long) As String
    '需引用Microsoft VBScript regular Expressions
    Dim Re As New RegExp, Macth, Macths
    Dim S As String, S1 As String, S2 As String
    '防止出现源文件路径中包含 多次数字紧跟“.”的情况,例如:d:/123.45/ert22.tmp
    S1 = srcFile
    S = "1"
    Do Until S = S2
    Re.Pattern = "\D(\d+\..*)"
    Set Macths = Re.Execute(S1)
    For Each Macth In Macths
    S = Macth.Value
    Next
    Re.Pattern = "\d+\..*"
    Set Macths = Re.Execute(S)
    For Each Macth In Macths
    S2 = S
    S = Macth.Value
    Next
    S1 = S
    Loop
    S1 = Left$(srcFile, Len(srcFile) - Len(S))
    Re.Pattern = "\..*"
    Set Macths = Re.Execute(S)
    For Each Macth In Macths
    S2 = Macth.Value '获得扩展名
    Next
    S = Replace(S, S2, "") '去除扩展名得到数字
    S = S + Range '对数字进行计算
    ModifyFile = S1 & S & S2 '获得最后结果
    Set Re = Nothing
    End Function负数也是没有问题的,而且可以在路径中包含任意多的“.”、数字、任意长的扩展名
      

  10.   

    Option ExplicitPrivate Function ModifyFile(srcFile As String, Range As Long) As String
        Dim iPoint As Integer, iNumber As Integer
        Dim iLength As Integer, iNo As Long
        iPoint = InStr(srcFile, ".")
        iNumber = iPoint - 1
        Do While iPoint > 0 And Mid(srcFile, iNumber, 1) >= "0" And Mid(srcFile, iNumber, 1) <= "9"
            iNumber = iNumber - 1
        Loop
        iLength = iPoint - iNumber - 1
        iNo = Val(Mid(srcFile, iNumber + 1, iLength))
        ModifyFile = Left(srcFile, iNumber) & Right("0000000000000000" & iNo + Range, iLength) & Mid(srcFile, iPoint)
    End FunctionPrivate Sub Form_Load()
        Debug.Print ModifyFile("D:\BT\海贼王174.rmvb", 1)
        Debug.Print ModifyFile("D:\BT\海贼王174.rmvb", -1)
        Debug.Print ModifyFile("D:\BT\海贼王74.rmvb", 1)
        Debug.Print ModifyFile("D:\BT\海贼王74.rmvb", -1)
        Debug.Print ModifyFile("D:\BT\海贼王07.rmvb", 1)
        Debug.Print ModifyFile("D:\BT\海贼王07.rmvb", -1)
        End
    End Sub
      

  11.   

    当初是想限制:没有多个扩展名,也没有多个点,后来想想算了,何必扼杀天才呢
    果然 lizhigao(李志高) 出现了,但是也没有处理好前导“0”。
    如:srcFile = D:\BT\海贼王07..rmvb , Range = 1
    应返回        D:\BT\海贼王08..rmvb ,你的结果:D:\BT\海贼王8..rmvb
      

  12.   

    修正一下子啦S = Replace(S, S2, "") '去除扩展名得到数字
    S1=len(S)
    S = S + Range '对数字进行计算
    ModifyFile = S1 & Format(S, left("0000000000000",S1)) & S2 '获得最后结果
      

  13.   

    测试条件:1、srcFile = "D:\BT\海贼王0740.rmvb";Range = 1 
    2、srcFile = "D:\BT\海贼王9.rmvb";Range = 101 
    3、srcFile = "D:\BT\海贼王070..rmvb";Range = 1030 (能通过就算完了)我的代码,通过 1、2,已优化,稍后贴出
      

  14.   

    1、srcFile = "D:\BT\海贼王0740.rmvb";Range = 1 
       D:\BT\海贼王0741.rmvb
    2、srcFile = "D:\BT\海贼王9.rmvb";Range = 101 
       D:\BT\海贼王110.rmvb3、srcFile = "D:\BT\海贼王070..rmvb";Range = 1030
       D:\BT\海贼王1100.rmvb测试通过!
    最终代码:Private Function ModifyFile(srcFile As String, Range As Long) As String
    '需引用Microsoft VBScript regular Expressions
    Dim Re As New RegExp, Macth, Macths
    Dim S As String, S1 As String, S2 As String,S3 As Integer
    '防止出现源文件路径中包含 多次数字紧跟“.”的情况,例如:d:/123.45/ert22.tmp
    S1 = srcFile
    S = "1"
    Do Until S = S2
    Re.Pattern = "\D(\d+\..*)"
    Set Macths = Re.Execute(S1)
    For Each Macth In Macths
    S = Macth.Value
    Next
    Re.Pattern = "\d+\..*"
    Set Macths = Re.Execute(S)
    For Each Macth In Macths
    S2 = S
    S = Macth.Value
    Next
    S1 = S
    Loop
    S1 = Left$(srcFile, Len(srcFile) - Len(S))
    Re.Pattern = "\..*"
    Set Macths = Re.Execute(S)
    For Each Macth In Macths
    S2 = Macth.Value '获得扩展名
    Next
    S = Replace(S, S2, "") '去除扩展名得到数字
    S3 = Len(S)
    S = S + Range '对数字进行计算
    ModifyFile = S1 & Format(S, Left("0000000000000", S3)) & S2 '获得最后结果
    Set Re = Nothing
    End Function
      

  15.   

    如个这个也过了,那应该是终极答案了3、srcFile = "D:\BT\海贼王-7..rmvb";Range = 8
    返回  D:\BT\海贼王1..rmvb
      

  16.   

    呵呵,又要修改了,负号还是没处理测试通过了Private Function ModifyFile(srcFile As String, Range As Long) As String
    '需引用Microsoft VBScript regular Expressions
    Dim Re As New RegExp, Macth, Macths
    Dim S As String, S1 As String, S2 As String
    '防止出现源文件路径中包含 多次数字紧跟“.”的情况,例如:d:/123.45/ert22.tmp
    S1 = srcFile
    S = "1"
    Do Until S = S2
    Re.Pattern = "\D(\d+\..*)"
    Set Macths = Re.Execute(S1)
    For Each Macth In Macths
    S = Macth.Value
    Next
    Re.Pattern = "-?\d+\..*"
    Set Macths = Re.Execute(S)
    For Each Macth In Macths
    S2 = S
    S = Macth.Value
    Next
    S1 = S
    MsgBox S & " - " & S2
    Loop
    S1 = Left$(srcFile, Len(srcFile) - Len(S))
    Re.Pattern = "\..*"
    Set Macths = Re.Execute(S)
    For Each Macth In Macths
    S2 = Macth.Value '获得扩展名
    Next
    S = Replace(S, S2, "") '去除扩展名得到数字
    Dim S3 As Integer
    S3 = Len(Replace(S, "-", ""))
    MsgBox S
    S = S + Range '对数字进行计算
    ModifyFile = S1 & Format(S, Left("0000000000000", S3)) & S2 '获得最后结果
    Set Re = Nothing
    End Function
      

  17.   

    - -学习。。这种匹配用了正则不用if简直就是绕圈子加几个if应该会简单许多吼吼。。
      

  18.   

    Option ExplicitPrivate Function ModifyFile(srcFile As String, Range As Long) As String
        Dim iPoint As Integer, iNumber As Integer, sChar As String, bDec As Boolean, bDot As Boolean
        Dim iLength As Integer, iNo As Long, sNo As String
        iPoint = InStrRev(srcFile, ".")
        iNumber = iPoint
        sChar = Mid(srcFile, iNumber, 1)
        Do
            bDec = sChar <> "-"
            bDot = sChar = "."
            iNumber = iNumber - 1
            sChar = Mid(srcFile, iNumber, 1)
        Loop While iPoint > 0 And ((sChar >= "0" And sChar <= "9") Or (sChar = "-" And bDec) Or (sChar = "." And bDot))
        iLength = iPoint - iNumber - 1
        iNo = Val(Mid(srcFile, iNumber + 1, iLength)) + Range
        iLength = IIf(Len(Trim(iNo)) > iLength, Len(Trim(iNo)), iLength)
        sNo = IIf(iNo < 0, "-", "") & Right("0000000000000000" & Abs(iNo), iLength - IIf(iNo < 0, 1, 0))
        ModifyFile = Left(srcFile, iNumber) & sNo & Mid(srcFile, iPoint)
    End FunctionPrivate Sub Form_Load()
        Debug.Print ModifyFile("D:\BT\海贼王0740.rmvb", 1)
        Debug.Print ModifyFile("D:\BT\海贼王9.rmvb", 101)
        Debug.Print ModifyFile("D:\BT\海贼王070..rmvb", 1030)
        Debug.Print ModifyFile("D:\BT\海贼王-07.rmvb", -1)
        Debug.Print ModifyFile("D:\BT\海贼王-07.rmvb", 8)
        End
    End Sub
      

  19.   

    To:TalentLi不使用判断语句只是为了让问题更有趣,你也可以先解决在优化
      

  20.   

    To:
    D:\BT\海贼王0740.rmvb        1            D:\BT\海贼王0741.rmvb
    D:\BT\海贼王9.rmvb           101          D:\BT\海贼王110.rmvb
    D:\BT\海贼王070..rmvb        1030         D:\BT\海贼王1100.rmvb  ○
    D:\BT\海贼王-07.rmvb        -1            D:\BT\海贼王-08.rmvb
    D:\BT\海贼王-07.rmvb         8            D:\BT\海贼王001.rmvb   ○
    D:\BT\海贼王-07.rmvb         1            D:\BT\海贼王-06.rmvb2项没通过
      

  21.   

    用Val函数取出数字,再加1减1,再替换回去
      

  22.   

    尽量不使用判断语句(可选,但这样比较有趣)循环体也不该用吧(循环也包含判断语句吧,要不怎退出)--------------Private Function ModifyFile(srcFile As String, Range As Integer) As String    Dim ipos As Integer, iStart As Integer, DiffCounter As Integer, PointNum As Integer
        Dim Extension As String
        Dim FileName As String, HalfName As String, L As Integer
        Dim tmpNo As String, No As String, Minus As Integer
        
        ipos = InStrRev(srcFile, ".")
        
        Extension = Right(srcFile, Len(srcFile) - ipos)
        
        FileName = Left(srcFile, ipos - 1)
        
        L = Len(FileName)
        FileName = Replace(FileName, ".", "")
        PointNum = L - Len(FileName)
        
        tmpNo = StrReverse(CStr(Val(StrReverse(FileName))))
        
        Debug.Print CStr(Val(StrReverse(FileName)))
        Debug.Print tmpNo
        
        DiffCounter = Len(tmpNo) - Len(CStr(Val(tmpNo)))
        
        Debug.Print DiffCounter    iStart = InStrRev(srcFile, tmpNo)    HalfName = Left(srcFile, iStart - 1)
        
        Debug.Print HalfName
        
        Minus = InStrRev(Right(HalfName, 1), "-")
        
        HalfName = Left(HalfName, Len(HalfName) - Minus)
        
        No = Mid(FileName, iStart)
        
        tmpNo = CStr(Val(No) * (-1) ^ Minus + Range)
        
        ModifyFile = HalfName & Replace(Left((-1) ^ InStr(tmpNo, "-"), 1), "1", "") _
                        & String(DiffCounter, "0") & Abs(tmpNo) & String(PointNum, ".") & "." & ExtensionEnd Function----
    楼主再测试一下,看有没有遗漏的
      

  23.   

    Private Sub DecodeFileName(ByVal srcFileName As String, _
                               ByRef FilePath As String, _
                               ByRef FileName As String, _
                               ByRef FileExt As String)
       Dim iPosExt As Integer
       Dim iPosPath As Integer
       Dim iLen As Integer
       
       FilePath = ""
       FileName = srcFileName
       FileExt = ""
       
       iLen = Len(FileName)
       iPosExt = InStrRev(srcFileName, ".")
       iPosPath = InStrRev(srcFileName, "\")
       
       FilePath = Mid(FileName, 1, iPosPath)
       
       FileExt = IIf(iPosExt > iPosPath, Mid(FileName, iPosExt, iLen - iPosExt + 1), FileExt)
       FileName = Mid(FileName, iPosPath + 1, iLen - Len(FileExt) - iPosPath)
       
    End SubPrivate Function ModifyFile(srcFile As String, Range As Integer) As String
       Dim FileName As String, FilePath As String, FileExt As String
       Dim iPosNum As Integer, iLen As Integer, iNumLen As Integer, i As Integer
       Dim strNum As String, strTMP As String, strFormat As String
       Call DecodeFileName(srcFile, FilePath, FileName, FileExt)
       iLen = Len(FileName)
       iPosNum = iLen
       iNumLen = 0
       Do While ("0" <= Mid(FileName, iPosNum, 1)) And ("9" >= Mid(FileName, iPosNum, 1))
          iPosNum = iPosNum - 1
          iNumLen = iNumLen + 1
       Loop
       
       strNum = Mid(FileName, iPosNum, iNumLen + 1)
       strTMP = Mid(strNum, 1, 1)
       strNum = Mid(strNum, 2, iNumLen)
       strTMP = Mid(strTMP, 1, InStr(strTMP, "-"))
       FileName = Mid(FileName, 1, iPosNum - Len(strTMP))
       strFormat = Replace(Space(InStr(strTMP, "-") + Len(strNum)), " ", "0")
       strNum = Format(Val(strTMP & strNum) + Range, strFormat)
       iPosNum = InStr(Mid(strNum, 1, 1), "-")
       strNum = Mid(Mid(strNum, 1, 1), 1, iPosNum + Len(strTMP)) & Mid(strNum, 1 + iPosNum + Len(strTMP), Len(strNum) - iPosNum)
       
       ModifyFile = FilePath & FileName & strNum & FileExtEnd Function
      

  24.   

    很高兴地看到:colorslife(霜水茶) 的代码一步一步地逼近完美,而且也是最符合没有判断语句的条件(严格讲,几乎每个VB内部函数在汇编级上都要用到条件跳转,但在VB程度上讲除了:IIf,Sgn及非记数的循环体外,应该可以视为符合条件,不然太没人道了)
    c:\kth-70..txt ,1 => c:\kth-69..txt 通过
    c:\kth1.74.txt ,1 => c:\kth2.74.txt 没通过
    还有几个近乎变态的条件,先不公布;
    个人认为:lizhigao(李志高)  的代码可能是最终的解决方案,虽然正则表达式是比较不符合没有判断语句的条件,拭目以待吧To:unsignedD:\BT\海贼王-07.rmvb,8    => D:\BT\海贼王001.rmvb
    D:\BT\海贼王70..rmvb , 1   => D:\BT\海贼王70.1.rmvb
      

  25.   

    哦哦哦,原來負號不作為一個格式化的長度處理,並且最後一個數值遞增
    -----------------------------
    Private Sub DecodeFileName(ByVal srcFileName As String, _
                               ByRef FilePath As String, _
                               ByRef FileName As String, _
                               ByRef FileExt As String)
       Dim iPosExt As Integer
       Dim iPosPath As Integer
       Dim iLen As Integer
       Dim strTMP As String
       Dim FileExtSelect(0 To 1) As Integer
       
       FileName = srcFileName
       
       iLen = Len(FileName)
       iPosExt = InStrRev(srcFileName, ".")
       iPosPath = InStrRev(srcFileName, "\")
       
       FilePath = Mid(FileName, 1, iPosPath)
       strTMP = Mid(LTrim(Str(iPosExt - iPosPath)), 1, 1)
       
       FileExtSelect(0) = 0
       FileExtSelect(1) = iLen + 1
       
       FileExt = Mid(FileName, iPosExt + FileExtSelect(InStr(strTMP, "-")))
       FileName = Mid(FileName, iPosPath + 1, iLen - Len(FileExt) - iPosPath)
       
    End SubPrivate Function ModifyFile(srcFile As String, Range As Integer) As String
       Dim FileName As String, FilePath As String, FileExt As String
       Dim iPosNum As Integer, iLen As Integer, iNumLen As Integer, i As Integer
       Dim strNum As String, strTMP As String, strFormat As String, strTail As String
       Call DecodeFileName(srcFile, FilePath, FileName, FileExt)
       
       iLen = Len(FileName)
       strTMP = Mid(FileName, iLen, 1)
       While (("0" > strTMP) Or ("9" < strTMP)) And iLen > 0
          strTail = Mid(FileName, iLen, 1) & strTail
          iLen = iLen - 1
          Do While iLen > 0
             strTMP = Mid(FileName, iLen, 1)
             Exit Do
          Loop
       Wend
       
       FileName = Mid(FileName, 1, iLen)
       
       iPosNum = iLen
       iNumLen = 0
       strNum = "0"
       
       Do While iPosNum > 0
          strTMP = Mid(FileName, iPosNum, 1)
          While ("0" <= strTMP) And ("9" >= strTMP) And iPosNum > 0
             iPosNum = iPosNum - 1
             iNumLen = iNumLen + 1
             Do While iPosNum > 0
                strTMP = Mid(FileName, iPosNum, 1)
                Exit Do
             Loop
          Wend
          strNum = Mid(FileName, iPosNum, iNumLen + 1)
          Exit Do
       Loop
       
       strTMP = Mid(strNum, 1, 1)
       strNum = Mid(strNum, 2, iNumLen)
       strTMP = Mid(strTMP, 1, InStr(strTMP, "-"))
       FileName = Mid(FileName, 1, iPosNum - Len(strTMP))
       strFormat = Replace(Space(Len(strNum)), " ", "0")
       strNum = Format(Val(strTMP & strNum) + Range, strFormat)
       
       ModifyFile = FilePath & FileName & strNum & strTail & FileExtEnd Function
      

  26.   

    发布第一个测试函数:Private Sub TestFun()
    Dim Sout As String, stmp As String
    Sout = "测试结果:" & vbLf & vbLfstmp = ModifyFile("D:\char0740.txt", 1)
    Sout = Sout & IIf(stmp = "D:\char0741.txt", "√", "×") & "  D:\char0740.txt, 1 " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char-7.txt", 8)
    Sout = Sout & IIf(stmp = "D:\char1.txt", "√", "×") & "  D:\char-7.txt, 8   " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char-70.txt", 1)
    Sout = Sout & IIf(stmp = "D:\char-69.txt", "√", "×") & "  D:\char-70.txt, 1 " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char70..txt", 1)
    Sout = Sout & IIf(stmp = "D:\char71..txt", "√", "×") & "  D:\char70..txt, 1 " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char70..txt", -10)
    Sout = Sout & IIf(stmp = "D:\char60..txt", "√", "×") & "  D:\char70..txt, -10 " & vbTab & "═﹥" & vbTab & stmp & vbLfMsgBox Sout, vbInformationEnd Sub
      

  27.   

    To:unsigned这位仁兄误解了,这个题目仅仅是小弟偶尔得来,研究后觉得其乐无穷,所谓的限定条件也只是小弟在不断深入了解之后的发现,如果unsigned兄认为有更合理的限定条件也可以提出来,之所以不先说是因为不想剥夺大家自己发现的乐趣。无他,但求共同提高而已!一下是本人的代码,尚不完整,请指教:Private Function ModifyFile(srcFile As String, Range As Long) As String
    Dim i As Integer, FileName As String, STxt As String, stmp As String
    Dim ExtPos As Integer, L As Integer, Num As Integeri = InStrRev(srcFile, "\")stmp = Mid(srcFile, i + 1)
    ExtPos = InStrRev(stmp, ".")
    ExtPos = InStr(ExtPos - 1, stmp, ".") '只处理“..”
    FileName = Left(stmp, ExtPos - 1)ExtPos = Len(stmp) - ExtPos + 1 '
    stmp = "1" & StrReverse(FileName) '可以处理后导 0  Stmp = CStr(Val(Stmp)) & "1"
    L = Len(CStr(Val(stmp))) - 1
    stmp = StrReverse(Mid(stmp, 2))   '去掉增加的后导 1
    STxt = Left(FileName, Len(FileName) - L)
    Num = 2 * Val(Right(STxt, 1) & "1A") + 1
    STxt = Left(STxt, Len(STxt) + Num)stmp = Mid(stmp, Len(STxt) + 1)
    stmp = Format(Val(stmp) + Range, String(L, "0"))  '可以处理前导 0
    ModifyFile = Left(srcFile, i) & STxt & stmp & Right(srcFile, ExtPos)
    End Function
      

  28.   

    L 实在是多余的变量,用i代替,修改如下Private Function ModifyFile(srcFile As String, Range As Long) As String
    Dim FileName As String, STxt As String, stmp As String
    Dim i As Integer, ExtPos As Integer, Num As Integeri = InStrRev(srcFile, "\")stmp = Mid(srcFile, i + 1)
    ExtPos = InStrRev(stmp, ".")
    ExtPos = InStr(ExtPos - 1, stmp, ".") '只处理“..”
    FileName = Left(stmp, ExtPos - 1)ExtPos = Len(stmp) - ExtPos + 1 'stmp = "1" & StrReverse(FileName) '可以处理后导 0
    i = Len(CStr(Val(stmp))) - 1
    stmp = StrReverse(Mid(stmp, 2))   '去掉增加的后导 1
    STxt = Left(FileName, Len(FileName) - i)
    Num = 2 * Val(Right(STxt, 1) & "1A") + 1
    STxt = Left(STxt, Len(STxt) + Num)stmp = Mid(stmp, Len(STxt) + 1)
    stmp = Format(Val(stmp) + Range, String(i, "0"))  '可以处理前导 0ModifyFile = Left(srcFile, Len(srcFile) - Len(FileName) - ExtPos) & STxt & stmp & Right(srcFile, ExtPos)
    End Function
      

  29.   

    C:\Film.2006\04-03\New.RM\F2005-12-076.Full.Test..RMVB,256
    C:\Film.2006\04-03\New.RM\F2005-12-.76.Full.Test..RMVB,25
    C:\Film.2006\04-03\New.RM\F2005-12-.76.Full12.Test..RMVB,-6
      

  30.   

    <br><p>
    to:unsigned期待的返回值是什么
      

  31.   

    To:unsigned您对于我及我的代码的推断是客观及公正的!对于代码的缺陷我们也有相似的结论!每当贴出一个代码,总希望能别人能看到一点不同的东西,因此会不断完善中;
    编程仅仅是我的兴趣,请谅解我的视角过于脱离实际。最后,非常感谢能分享你的代码(详尽而又严谨),很多人会因此受益的,包括小弟我!
      

  32.   

    c:\kth1.74.txt ,1 => c:\kth2.74.txt 没通过
    -----------------
    下面的代码已可以通过上面的测试,哈哈,有意思……Private Function ModifyFile(srcFile As String, Range As Integer) As String    Dim ipos As Integer, iStart As Integer, DiffCounter As Integer
        Dim Extension As String, FilePath As String
        Dim FileName As String, HalfName As String
        Dim tmpNo As String, No As String, Minus As Integer
        
        ipos = InStrRev(srcFile, "\")
        FilePath = Left(srcFile, ipos)
        FileName = Mid(srcFile, ipos + 1)
        
        ipos = InStr(FileName, ".")
        
        Extension = Mid(FileName, ipos)
        
        FileName = Left(FileName, Len(FileName) - Len(Extension))
        
        tmpNo = StrReverse(CStr(Val(StrReverse(FileName))))
        
        DiffCounter = Len(tmpNo) - Len(CStr(Val(tmpNo)))    iStart = InStrRev(FileName, tmpNo)    HalfName = Left(FileName, iStart - 1)
        
        Minus = InStrRev(Right(HalfName, 1), "-")
        
        HalfName = Left(HalfName, Len(HalfName) - Minus)
        
        No = Mid(FileName, iStart)
        
        tmpNo = CStr(Val(No) * (-1) ^ Minus + Range)
        
        ModifyFile = FilePath & HalfName & Replace(Left((-1) ^ InStr(tmpNo, "-"), 1), "1", "") _
                        & String(DiffCounter, "0") & Abs(tmpNo) & ExtensionEnd Function------
    楼主继续……
      

  33.   

    没有多个扩展名,也没有多个点,后来想想算了,何必扼杀天才呢
    --------------
    srcFile = "D:\BT\海贼王74.cs.25.rmvb";Range = 1 上面这样的情况, .cs.25属于文件名还是属于扩展名呢?我的理解是"."之后都属于扩展名所以,结果返回 D:\BT\海贼王75.cs.25.rmvb--------
    楼主这样理解对吗?
      

  34.   

    繼續......
    -----------------------------------
    Private Sub DecodeFileName(ByVal srcFileName As String, _
                               ByRef FilePath As String, _
                               ByRef FileName As String, _
                               ByRef FileExt As String)
       Dim iPosExt As Integer
       Dim iPosPath As Integer
       Dim iLen As Integer
       Dim strTMP As String
       Dim FileExtSelect(0 To 1) As Integer
       
       FileName = srcFileName
       
       iLen = Len(FileName)
       iPosExt = InStrRev(srcFileName, ".")
       iPosPath = InStrRev(srcFileName, "\")
       
       FilePath = Mid(FileName, 1, iPosPath)
       strTMP = Mid(LTrim(Str(iPosExt - iPosPath)), 1, 1)
       
       FileExtSelect(0) = 0
       FileExtSelect(1) = iLen + 1
       
       FileExt = Mid(FileName, iPosExt + FileExtSelect(InStr(strTMP, "-")))
       FileName = Mid(FileName, iPosPath + 1, iLen - Len(FileExt) - iPosPath)
       
    End SubPrivate Function ModifyFile(srcFile As String, Range As Integer) As String
       Dim FileName As String, FilePath As String, FileExt As String
       Dim iPosNum As Integer, iLen As Integer, iNumLen As Integer, i As Integer
       Dim strNum As String, strTMP As String, strFormat As String, strTail As String
       Dim SelectFileName(0 To 1) As String
       Call DecodeFileName(srcFile, FilePath, FileName, FileExt)
       
       iLen = Len(FileName)
       Do While iLen > 0
       strTMP = Mid(FileName, iLen, 1)
          Exit Do
       Loop
       While (("0" > strTMP) Or ("9" < strTMP)) And iLen > 0
          strTail = Mid(FileName, iLen, 1) & strTail
          iLen = iLen - 1
          Do While iLen > 0
             strTMP = Mid(FileName, iLen, 1)
             Exit Do
          Loop
       Wend
       
       FileName = Mid(FileName, 1, iLen)
       
       iPosNum = iLen
       iNumLen = 0
       strNum = "0"
       
       Do While iPosNum > 0
          strTMP = Mid(FileName, iPosNum, 1)
          While ((("0" <= strTMP) And ("9" >= strTMP)) Or ("-" = strTMP)) And iPosNum > 0
             
             iPosNum = iPosNum - 1
             iNumLen = iNumLen + 1
             Do While iPosNum > 0
                strTMP = Mid(FileName, iPosNum, 1)
                
                Exit Do
             Loop
          Wend
          strNum = Mid(FileName, iPosNum + 1, iNumLen)
          Exit Do
       Loop
       
       strTMP = Mid(strNum, 1, 1)
       strNum = Mid(strNum, 1 + (Len(strNum) - iNumLen), iNumLen)
       strTMP = Mid(strTMP, 1, InStr(strTMP, "-"))   strFormat = Replace(Space(Len(strNum) - InStr(strTMP, "-")), " ", "0")
       strNum = Format(Val(strNum) + Range, strFormat)
       
       SelectFileName(0) = strTail & strNum
       SelectFileName(1) = strNum & strTail
       
       ModifyFile = FilePath & Mid(FileName, 1, iPosNum) & SelectFileName(Len(Left(FileName, 1))) & FileExtEnd Function
      

  35.   

    发展到现在已经不是算法实现的问题,当务之急是确立一个公正客观的测试条件,参考Excel2000的自动递增功能,草案如下:欢迎指正基本原则:1、不考虑目录路径中的数字;
    2、如果最后一个扩展名是数字的话,视为一般扩展名,不考虑。条件:1、允许多个连续的点(.);
    2、允许正负小数(包括srcFile和Range,如tx1.123.txt,则1.123为一整体);
    3、允许多个扩展名,但不允许数字扩展名
    4、数字接负号再接数字时,-为一般字符,如Part1-4.mp3,对4(不是-4)累加补充:如果允许数字扩展名则  (1)多个数字扩展名时,只考虑最后一个扩展名(如34.tx.123.txt,对123累加)
      (2)2个(最后)数字扩展名视为小数
    自己都觉得变味了,是不是本着精益求精的态度,对已有的代码修改优化比较好。
    以上纯属一家之言!!!
      

  36.   

    是我表达混淆了,因为要表达如:C:\doc\data2005.06.22.txt不用多个扩展名还真不知怎么表达
      

  37.   

    To:unsigned问题到这份上似乎没有继续的必要了,不知unsigned是否有同感?!
      

  38.   

    Private Sub DecodeFileName(ByVal srcFileName As String, _
                               ByRef FilePath As String, _
                               ByRef FileName As String, _
                               ByRef FileExt As String)
       Dim iPosExt As Integer
       Dim iPosPath As Integer
       Dim iLen As Integer
       Dim strTMP As String
       Dim FileExtSelect(0 To 1) As Integer
       
       FileName = srcFileName
       
       iLen = Len(FileName)
       iPosExt = InStrRev(srcFileName, ".")
       iPosPath = InStrRev(srcFileName, "\")
       
       FilePath = Mid(FileName, 1, iPosPath)
       strTMP = Mid(LTrim(Str(iPosExt - iPosPath)), 1, 1)
       
       FileExtSelect(0) = 0
       FileExtSelect(1) = iLen + 1
       
       FileExt = Mid(FileName, iPosExt + FileExtSelect(InStr(strTMP, "-")))
       FileName = Mid(FileName, iPosPath + 1, iLen - Len(FileExt) - iPosPath)
       
    End SubPrivate Function ModifyFile(srcFile As String, Range As Currency) As String
       Dim FileName As String, FilePath As String, FileExt As String
       Dim iPosNum As Integer, iPosDot As Integer, iPosOri As Integer
       Dim bDot As Boolean, bEndLoop As Boolean
       Dim iLen As Integer, iNumLen As Integer, i As Integer
       Dim strNum As String, strTMP As String, strFormat As String, strTail As String
       Dim SelectFileName(0 To 1) As String
       Call DecodeFileName(srcFile, FilePath, FileName, FileExt)
       iLen = Len(FileName)
       iPosNum = iLen
       Do While iLen > 0
          strTMP = Mid(FileName, iPosNum, 1)
          Exit Do
       Loop
       While (iPosNum > 0) And (InStr("1234567890", strTMP) = 0)
          iPosNum = iPosNum - 1
           Do While iLen > 0
             strTMP = Mid(FileName, iPosNum, 1)
             Exit Do
          Loop
       Wend
       
       Do While iPosNum > 0
          Do While iPosNum < iLen
             strTail = Mid(FileName, iPosNum + 1)
             Exit Do
          Loop
          While iPosNum > 0 And ((InStr("1234567890", strTMP) > 0) Or ((Not bDot) And (strTMP = ".")) Or (strTMP = "-")) And (Not bEndLoop)
             Do While strTMP = "."
                bDot = True
                iPosNum = iPosNum - 1
                
                Do While iPosNum > 0
                   Do While InStr("1234567890", Mid(FileName, iPosNum, 1)) = 0
                      iPosNum = iPosNum + 1
                      bEndLoop = True
                      Exit Do
                   Loop
                   Exit Do
                Loop
                
                iPosNum = iPosNum + 1
                Exit Do
             Loop
             Do While strTMP = "-"
                iPosNum = iPosNum - 1
                
                Do While iPosNum > 0
                   Do While InStr("1234567890", Mid(FileName, iPosNum, 1)) > 0
                      iPosNum = iPosNum + 1
                      
                      Exit Do
                   Loop
                   Exit Do
                Loop
                
                iPosNum = iPosNum + 1
                bEndLoop = True
                
                Exit Do
             Loop
             Do While Not bEndLoop
                iPosNum = iPosNum - 1
                Exit Do
             Loop
             Do While iPosNum > 0
                strTMP = Mid(FileName, iPosNum, 1)
                Exit Do
             Loop
          Wend
          Do While Not bEndLoop
             iPosNum = iPosNum + 1
             Exit Do
          Loop
          Exit Do
       Loop
       Do While iPosNum = 0
          strNum = "0"
          Exit Do
       Loop
       Do While iPosNum > 0
          strNum = Mid(FileName, iPosNum, iLen - Len(strTail) - (iPosNum - 1))
          strTMP = Replace(strNum, "-", "")
          iPosDot = InStr(strTMP, ".")
          Do While iPosDot = 0
             strFormat = Replace(Space(Len(strTMP)), " ", "0")
             Exit Do
          Loop
          Do While iPosDot > 0
             strFormat = Replace(Space(iPosDot - 1), " ", "0") & "." & Replace(Space(Len(strTMP) - iPosDot), " ", "0")
             Exit Do
          Loop
          FileName = Mid(FileName, 1, iPosNum - 1)
          Exit Do
       Loop
       
       ModifyFile = FilePath & FileName & Format(Val(strNum) + Range, strFormat) & strTail & FileExt
       
    End Function
      

  39.   

    改用IF語句:
    -----------------------------------------------
    Private Sub DecodeFileName(ByVal srcFileName As String, _
                               ByRef FilePath As String, _
                               ByRef FileName As String, _
                               ByRef FileExt As String)
       Dim iPosExt As Integer
       Dim iPosPath As Integer
       Dim iLen As Integer
       
       FileName = srcFileName
       
       iLen = Len(FileName)
       iPosExt = InStrRev(srcFileName, ".")
       iPosPath = InStrRev(srcFileName, "\")
       
       FilePath = Mid(FileName, 1, iPosPath)
       FileExt = Mid(FileName, iPosExt + IIf(iPosExt < iPosPath, iLen + 1, 0))
       FileName = Mid(FileName, iPosPath + 1, iLen - Len(FileExt) - iPosPath)
       
    End SubPrivate Function ModifyFile(ByVal srcFile As String, _
                                ByVal Range As Currency) As String
                                
       Dim FileName As String, FilePath As String, FileExt As String, strTail As String
       Dim strNum As String, strTMP As String, strFormat As String
       Dim iPosNum As Integer, iPosDot As Integer, iLen As Integer
       Dim bDot As Boolean
       
       Call DecodeFileName(srcFile, _
                           FilePath, _
                           FileName, _
                           FileExt)
       
       iLen = Len(FileName)
       iPosNum = iLen
       If iLen > 0 Then strTMP = Mid(FileName, iPosNum, 1)
       
       While (iPosNum > 0) And (InStr("1234567890", strTMP) = 0)
          iPosNum = iPosNum - 1
          If iPosNum > 0 Then strTMP = Mid(FileName, iPosNum, 1)
       Wend
       
       If iPosNum = 0 Then
          strNum = "0"
       Else
          If iPosNum < iLen Then strTail = Mid(FileName, iPosNum + 1)
             
          Do While iPosNum > 0 And ((InStr("1234567890", strTMP) > 0) Or ((Not bDot) And (strTMP = ".")) Or (strTMP = "-"))
             If strTMP = "." Then
                bDot = True
                If 0 < (iPosNum - 1) Then
                   If InStr("1234567890", Mid(FileName, iPosNum - 1, 1)) = 0 Then Exit Do
                End If
             End If
             
             If strTMP = "-" Then
                If 0 < (iPosNum - 1) Then
                   If InStr("1234567890", Mid(FileName, iPosNum - 1, 1)) > 0 Then iPosNum = iPosNum + 1
                End If
                iPosNum = iPosNum - 1
                Exit Do
             End If
             
             iPosNum = iPosNum - 1
             If iPosNum > 0 Then strTMP = Mid(FileName, iPosNum, 1)
          Loop
          
          iPosNum = iPosNum + 1
          
       End If
       
       If iPosNum > 0 Then
          strNum = Mid(FileName, iPosNum, iLen - Len(strTail) - (iPosNum - 1))
          strTMP = Replace(strNum, "-", "")
          iPosDot = InStr(strTMP, ".")
          If iPosDot = 0 Then
             strFormat = Replace(Space(Len(strTMP)), " ", "0")
          Else
             strFormat = Replace(Space(iPosDot - 1), " ", "0") & "." & Replace(Space(Len(strTMP) - iPosDot), " ", "0")
          End If
          FileName = Mid(FileName, 1, iPosNum - 1)
       End If
       
       ModifyFile = FilePath & FileName & Format(Val(strNum) + Range, strFormat) & strTail & FileExt
       
    End Function
      

  40.   

    unsigned(僵哥)  的水准让我汗颜。
      

  41.   

    Private Function ModifyFile(FileName As String, Rang As Long) As Boolean
        Dim FilNum As String '文件名中的数字
        Dim Path As String '文件路径
        Dim Str As String '临时字符,中间变量
        Dim NumLen As Integer '文件中数字的长度
        ModifyFile = True
        If InStrRev(FileName, ".") < 0 Then '如果确定给的是合法的文件路径,这个判断可以去掉
            ModifyFile = False
            Exit Function
        End If
        Path = Left(FileName, InStrRev(FileName, ".") - 1) '取除扩展名的文件路径
        Str = Right(Path, 1)
        FilNum = ""
        Do While IsNumeric(Str) '循环找数字
            FilNum = Str & FilNum
            Path = Left(Path, Len(Path) - 1)
            Str = Right(Path, 1)
        Loop
        If Val(FilNum) = 0 Then '为零的时候总得判断吧,否则变-1了~~
            ModifyFile = False
            Exit Function
        End If
        NumLen = Len(FilNum) '取原文件名中数字的长度
        Str = Val(FilNum) + Rang '数字增加或减少
        Str = Format(Str, String(NumLen, "0")) '使数字长度与原文件名中的数字长度相同,不要这种效果这句可以不要
        Path = Path & Str & Mid(FileName, InStrRev(FileName, ".")) '连接完整路径名
        Text1.Text = Path '输出
    End Function
    '===================
    能不能加点分??
    我好久没加分了~~~~~~~~~~
      

  42.   

    建议 fishmans 参考一下colorslife(霜水茶) ( ) 信誉:100  2006-04-03 14:52:00  unsigned(僵哥)                    2006-04-03 20:16:00lizhigao(李志高) ( ) 信誉:100    2006-04-02 17:53:00的代码,这个函数不花一点时间是不行的,虽然不需要很高深的知识
      

  43.   

    2、允许正负小数(包括srcFile和Range,如tx1.123.txt,则1.123为一整体);
    --------------
    Private Function ModifyFile(srcFile As String, Range As Long) As String楼主给的函数模板中Range定义为Long,现在又允许正负小数唉,需求变化无常啊。
      

  44.   

    在Excel 中,如果单元格的内容为kt1.7,下拉时会依次出现kt1.8,kt1.9,kt1.10  ...但Range已定义为Long,修改如下:基本原则:1、不考虑目录路径中的数字;  
    2、如果最后一个扩展名是数字的话,视为一般扩展名,不考虑。  
    3、负号 不考虑占位(参考僵哥的意见)条件:1、允许多个连续的点(.);  
    2、srcFile允许正负小数(如tx1.123.txt,则1.123为一整体);(参考colorslife的意见)  
    3、允许多个扩展名,但不允许数字扩展名  
    4、数字接负号再接数字时,-为一般(连接)字符,如Part1-4.mp3,对4(不是-4)累加  
     
    补充:如果允许数字扩展名则  
     
       (1)多个数字扩展名时,只考虑最后一个扩展名(如34.tx.123.txt,对123累加)  
       (2)2个(最后)数字扩展名视为小数
      

  45.   

    贴出2个过渡测试函数:Private Sub TestFun2()
    Dim Sout As String, stmp As String
    Sout = "测试结果:" & vbLf & vbLfstmp = ModifyFile("D:\char74....txt", 1)
    Sout = Sout & IIf(stmp = "D:\char75....txt", "√", "×") & "  D:\char74....txt, 1 " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char74.t2t.txt", 1)
    Sout = Sout & IIf(stmp = "D:\char75.t2t.txt", "√", "×") & "  D:\char74.t2t.txt, 8   " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\Part1-70.txt", 1)
    Sout = Sout & IIf(stmp = "D:\Part1-71.txt", "√", "×") & "  D:\Part1-70.txt, 1 " & vbTab & "═﹥" & vbTab & stmpMsgBox Sout, vbInformation
    End SubPrivate Sub TestFun3()
    Dim Sout As String, stmp As String
    Sout = "测试结果:" & vbLf & vbLfstmp = ModifyFile("D:\char.74.part.9.txt", 1)
    Sout = Sout & IIf(stmp = "D:\char.74.part.10.txt", "√", "×") & "  D:\char.74.part.9.txt, 1 " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char2006.11.7.txt", 1)
    Sout = Sout & IIf(stmp = "D:\char2006.11.7.txt", "√", "×") & "  D:\char2006.12.7.txt, 1 " & vbTab & "═﹥" & vbTab & stmpMsgBox Sout, vbInformation
    End Sub
      

  46.   

    TestFun3中的:
    stmp = ModifyFile("D:\char2006.11.7.txt", 1)
    Sout = Sout & IIf(stmp = "D:\char2006.11.7.txt", "√", "×") & "  D:\char2006.12.7.txt, 1 " & vbTab & "═﹥" & vbTab & stmp應當改為:
    stmp = ModifyFile("D:\char2006.11.7.txt", 1)
    Sout = Sout & IIf(stmp = "D:\char2006.12.7.txt", "√", "×") & "  D:\char2006.11.7.txt, 1 " & vbTab & "═﹥" & vbTab & stmp
      

  47.   

    Private Sub DecodeFileName(ByVal srcFileName As String, _
                               ByRef FilePath As String, _
                               ByRef FileName As String, _
                               ByRef FileExt As String)
       Dim iPosExt As Integer
       Dim iPosPath As Integer
       Dim iLen As Integer
       
       FileName = srcFileName
       
       iLen = Len(FileName)
       iPosExt = InStrRev(srcFileName, ".")
       iPosPath = InStrRev(srcFileName, "\")
       
       FilePath = Mid(FileName, 1, iPosPath)
       FileExt = Mid(FileName, iPosExt + IIf(iPosExt < iPosPath, iLen + 1, 0))
       FileName = Mid(FileName, iPosPath + 1, iLen - Len(FileExt) - iPosPath)
       
    End SubPrivate Function ModifyFile(ByVal srcFile As String, _
                                ByVal Range As Currency) As String
                                
       Dim FileName As String, FilePath As String, FileExt As String, strTail As String
       Dim strNum As String, strTMP As String, strFormat As String
       Dim iPosNum As Integer, iPosDot As Integer, iLen As Integer
       Dim bDot As Boolean
       
       Call DecodeFileName(srcFile, _
                           FilePath, _
                           FileName, _
                           FileExt)
       
       iLen = Len(FileName)
       iPosNum = iLen
       If iLen > 0 Then strTMP = Mid(FileName, iPosNum, 1)
       
       While (iPosNum > 0) And (InStr("1234567890", strTMP) = 0)
          'Add=============
          Do While iPosNum > 0 And strTMP <> "."
             iPosNum = iPosNum - 1
             If iPosNum > 0 Then strTMP = Mid(FileName, iPosNum, 1)
          Loop
          'End=============
          iPosNum = iPosNum - 1
          If iPosNum > 0 Then strTMP = Mid(FileName, iPosNum, 1)
       Wend
       
       If iPosNum = 0 Then
          strNum = "0"
       Else
          If iPosNum < iLen Then strTail = Mid(FileName, iPosNum + 1)
             
          Do While iPosNum > 0 And ((InStr("1234567890", strTMP) > 0) Or ((Not bDot) And (strTMP = ".")) Or (strTMP = "-"))
             If strTMP = "." Then
                bDot = True
                If 0 < (iPosNum - 1) Then
                   If InStr("1234567890", Mid(FileName, iPosNum - 1, 1)) = 0 Then Exit Do
                End If
             End If
             
             If strTMP = "-" Then
                If 0 < (iPosNum - 1) Then
                   If InStr("1234567890", Mid(FileName, iPosNum - 1, 1)) > 0 Then iPosNum = iPosNum + 1
                End If
                iPosNum = iPosNum - 1
                Exit Do
             End If
             
             iPosNum = iPosNum - 1
             If iPosNum > 0 Then strTMP = Mid(FileName, iPosNum, 1)
          Loop
          
          iPosNum = iPosNum + 1
          
       End If
       
       If iPosNum > 0 Then
          strNum = Mid(FileName, iPosNum, iLen - Len(strTail) - (iPosNum - 1))
          strTMP = Replace(strNum, "-", "")
          iPosDot = InStr(strTMP, ".")
          If iPosDot = 0 Then
             strFormat = Replace(Space(Len(strTMP)), " ", "0")
          Else
             strFormat = Replace(Space(iPosDot - 1), " ", "0") & "." & Replace(Space(Len(strTMP) - iPosDot), " ", "0")
          End If
          FileName = Mid(FileName, 1, iPosNum - 1)
       End If
       
       ModifyFile = FilePath & FileName & Format(Val(strNum) + Range, strFormat) & strTail & FileExt
       
    End Function
      

  48.   

    To:unsigned(僵哥)确实是错了!而且也少了一个项目(过了),一并贴出,最后:你是天才!!Private Sub TestFun()
    Dim Sout As String, stmp As String
    Sout = "测试结果:" & vbLf & vbLfstmp = ModifyFile("D:\char0740.txt", 1)
    Sout = Sout & IIf(stmp = "D:\char0741.txt", "√", "×") & "  D:\char0740.txt, 1 " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char-7.txt", 8)
    Sout = Sout & IIf(stmp = "D:\char1.txt", "√", "×") & "  D:\char-7.txt, 8   " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char-70.txt", 1)
    Sout = Sout & IIf(stmp = "D:\char-69.txt", "√", "×") & "  D:\char-70.txt, 1 " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char70..txt", 1)
    Sout = Sout & IIf(stmp = "D:\char71..txt", "√", "×") & "  D:\char70..txt, 1 " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char70..txt", -10)
    Sout = Sout & IIf(stmp = "D:\char60..txt", "√", "×") & "  D:\char70..txt, -10 " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char-7.1.txt", 8)
    Sout = Sout & IIf(stmp = "D:\char0.9.txt", "√", "×") & "  D:\char-7.1.txt, 8   " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char74....txt", 1)
    Sout = Sout & IIf(stmp = "D:\char75....txt", "√", "×") & "  D:\char74....txt, 1 " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char74.t2t.txt", 1)
    Sout = Sout & IIf(stmp = "D:\char75.t2t.txt", "√", "×") & "  D:\char74.t2t.txt, 8   " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\Part1-70.txt", 1)
    Sout = Sout & IIf(stmp = "D:\Part1-71.txt", "√", "×") & "  D:\Part1-70.txt, 1 " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char.74.part.9.txt", 1)
    Sout = Sout & IIf(stmp = "D:\char.74.part.10.txt", "√", "×") & "  D:\char.74.part.9.txt, 1 " & vbTab & "═﹥" & vbTab & stmp & vbLfstmp = ModifyFile("D:\char2006.11.7.txt", 1)
    Sout = Sout & IIf(stmp = "D:\char2006.12.7.txt", "√", "×") & "  D:\char2006.11.7.txt, 1 " & vbTab & "═﹥" & vbTab & stmpMsgBox Sout, vbInformation
    End Sub