The code below retrieves an object from a listview, writes the data to a csv file then emails it. The first time through it works correctly but if I have it do it again without reloading the listview, the csv file is empty except for the header and ct.minutes is set to zero. The number of zeros equal the exact number of records so I know that it's stepping through the listview correctly.
Another odd thing is if I create the csv files using 'File.DirInternal' and attach it to an email, the file appears to be attached but the attachment is missing when I receive it. The way I was able to receive the attachment is to create the file using 'File.DirDefaultExternal'. Dunno if that makes sense to anyone.
B4X:
For i = 0 To lvcalls.Size - 1
ct.Initialize
ct = lvcalls.GetItem(i)
pline = ct.Ctype & "," & ct.Name & "," & ct.number & "," & ct.date & "," & ct.time & "," & ct.minutes
detailFile.WriteLine(pline)
Next
detailFile.Close
Another odd thing is if I create the csv files using 'File.DirInternal' and attach it to an email, the file appears to be attached but the attachment is missing when I receive it. The way I was able to receive the attachment is to create the file using 'File.DirDefaultExternal'. Dunno if that makes sense to anyone.