Sub FillList
'Dim KndLst As List
lstKunden.Initialize
Cursor1 = DBRoutines.SQL1.ExecQuery("SELECT Profile, Street, PostalCode, City FROM DBtest1")
File.OpenOutput(File.DirDefaultExternal, "Kundenliste.txt", True)
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
lstKunden = File.ReadList(File.DirDefaultExternal, "Kundenliste.txt")
Log("****************")
Log("lstKunden: " & lstKunden)
If lstKunden.IndexOf(Cursor1.GetString("Profile")) = -1 Then
'& Cursor1.GetString("Street") &CRLF& Cursor1.GetString("PostalCode") &", "& Cursor1.GetString("City")) = -1 Then
lstKunden.Add(Cursor1.GetString("Profile") &CRLF& Cursor1.GetString("Street") &CRLF& Cursor1.GetString("PostalCode") & ", " & Cursor1.GetString("City")&CRLF)
File.WriteList(File.DirDefaultExternal, "Kundenliste.txt", lstKunden)
End If
Next
Log("Size: " & lstKunden.Size)
'lstKunden.SortCaseInsensitive(True)
Cursor1.Close
FillListview1
End Sub