I want to use a table to show contents of CSV files found with the ContentChooser. The table is loaded and displayed correctly the first time. But if another file which has less rows than the previous one is picked, the trailing rows of the previous file are not removed. According to the description, LoadTableFromCSV should clear the table, but for some reason it does not. Neither does the clearall method.
Thanks for help! Georg
Result Event Content Chooser:
Sub CC_Result (Success As Boolean, Dir As String, FileName As String)
If Success = True Then
ParameterTable.Initialize(Me,"",7,1,False) 'new call for version 1.44
If Screenheight/Screenwidth < 0.45 Then 'rather wide like the flip
ParameterTable.AddToActivity(Activity, 40%x, 15%y, 460dip, 75%y) 'width is the sum of all dips below
ParameterTable.SetHeader(Array As String("ID", "Bezeichnung", "On", "Off","Reps","Wied.h","Aktiv"))
ParameterTable.RowHeight = 20dip
ParameterTable.SetColumnsWidths(Array As Int(30dip, 180dip, 50dip, 50dip, 50dip, 50dip,50dip))
Else
ParameterTable.AddToActivity(Activity, 40%x, 15%y, 550dip, 68%y) 'width is the sum of all dips below
ParameterTable.SetHeader(Array As String("ID", "Bezeichnung", "On", "Off","Reps","Wied.h","Aktiv"))
ParameterTable.SetColumnsWidths(Array As Int(50dip, 250dip, 50dip, 50dip, 50dip, 50dip,50dip))
End If
ChoosenDirectory = FileName
Log ("ChoosenDirectory: "&ChoosenDirectory)
If FileName.Contains( ".jpg") Then
ImageView1.Bitmap = LoadBitmap(Dir,FileName)
End If
If FileName.Contains (".csv") Then
ParameterTable.LoadTableFromCSV(Dir,FileName,True)
End If
Else
ToastMessageShow("No Success :(",True)
End If
End Sub
Thanks for help! Georg