文件处理
下一个递增的文件名(函数)
2016-06-18 17:35:11

Function NextFileName()    Dim fileprefix As String*1    Dim tempNextFileName As String    Dim txtFilePath As String    Dim strYYYYMM as String*6        strYYYYMM = Format(Now(),"yyyymm")    txtFilePath = "c:\exported_data\"    fileprefix = "A"    Do While True        tempNextFileName = txtFilePath & fileprefix & _                       strYYYYMM & ".txt"        If Dir(tempNextFileName) = "" Then            Exit Do        End If        fileprefix = Chr(Asc(fileprefix) + 1)    Loop    NextFileName = tempNextFileNameEnd Function