According the reading I have done if I save an array of string to a list and then that list to CSV the string array should be aligned in successive columns in a row
I have tried lots of variations on the attached, and all I can get is one column named "Name" in the row where there should be four values
Can someone assist please
I have tried lots of variations on the attached, and all I can get is one column named "Name" in the row where there should be four values
Can someone assist please
B4X:
Sub btnSaveRunData_Click
' Select Directory
Dim DC As DirectoryChooser
DC.Initialize
DC.InitialDirectory = "C:"
Dim Folder As String = DC.Show(MainForm)
' Get Time and Day
DateTime.TimeFormat="HH:mm"
Dim TimeMin As String = DateTime.Time(DateTime.Now)
DateTime.DateFormat = "dd MMM yyyy"
Dim TimeDay As String = DateTime.Date(DateTime.now)
Dim FileName As String = "NewData.csv"
' Add data row by row
Dim su As StringUtils
Dim List1 As List
List1.Initialize
List1.add(Array As String(TimeDay))
List1.add(Array As String(TimeMin))
List1.add(Array As String(EngineType))
List1.add(Array As String(EngineIdent1))
List1.add(Array As String(EngineIdent2))
List1.add(Array As String(EngineIdent3))
'' add headers for new data
Dim B(4) As String ' Row header for next lot of data
B(0) = "Name"
B(1) = "CC"
B(2) = "Max Power"
B(3) = "Max Torque"
List1.add(B)
For i = 0 To 99
'more line data here added to list
Next
su.SaveCSV(Folder, FileName, ",",List1)
End Sub