Sub SaveWorkoutsToCSV
Dim WorkoutList As List
Dim ExerciseList As List
Dim ne As Int 'row counter to check
Dim qry As String
Dim StringUtils As StringUtils
WorkoutList.Initialize
ExerciseList.Initialize
'workoutlist=DBUtils.ExecuteMemoryTable(SQL1,qry,Null,0)
'Msgbox(File.DirInternal,"workouts")
qry = "Select * from Workouts"
Dim cur As Cursor
cur = SQL1.ExecQuery(qry)
Msgbox(cur.RowCount,"number") 'check if any rows are found
For row = 0 To cur.RowCount - 1
cur.Position = row
Dim values(cur.ColumnCount) As String
For col = 0 To cur.ColumnCount - 1
values(col) = cur.GetString2(col)
Next
WorkoutList.Add(values)
'Msgbox(values(2),"values") 'check if any data found in col 2
Next
cur.Close
StringUtils.SaveCSV(File.Dirinternal, "workouts.csv", ",",WorkoutList)
End Sub