I'm trying to auto increment csv files, but I'm not having any luck. I found this post https://www.b4x.com/android/forum/threads/b4x-automatically-increment-file-names.95196/ but I was unable to get it to work. I may just be missing something. This is the code I'm currently using to create the csv.
B4X:
Sub btnRCSV_Click
Log("hit")
Dim List As List
Dim cursor As Cursor
Dim cols(3) As String
'
List.Initialize
Log("init")
cursor=SQL.ExecQuery("Select * From Receiving")
Log("query")
For i = 0 To cursor.RowCount - 1
Log("cycle " & i)
cursor.Position = i
For z = 0 To 2
Log(i & " - " & cursor.GetString2(z))
Next
cols = Array As String(cursor.GetString2(0),cursor.GetString2(1),cursor.GetString2(2))
List.Add(cols)
Next
Log("done cycle")
su.SaveCSV2(File.DirRootExternal, "ReceivingEdge.csv", ",", List, Array("Tracking", "DateTime", "Location"))
Log("save")
cursor.Close
Log("close")
Msgbox("CSV file saved","CSV")
End Sub