Hi
I am developing a small Mac app that reads in a recordset (via an ODBC connection) then iterates through the recordset, exporting the data as a text file using a stream.
The data is read in in about 1 second then the data is exported in a loop.
The exporting loop has a couple of things that I am using to try to provide some feedback on progress. A progress bar and a label with the record number being exported.
Neither is being updated, I just get the spinning wheel. Then when it is finished I just get the label updated to ‘Done’, which is my last line of code before exiting.
Here is the loop.
[code]lblExportCount.Text = Str(RecordCount)
// Loop through each row, one-by-one, and add it to the output file
If data <> Nil Then
RecordNumber = 1
While Not data.EOF
'progress bar
prgExport.Value = (RecordNumber / RecordCount) * 100
'status labels
lblExportRecord.Text = Str(RecordNumber)
lblExportRecord.Refresh
'just formats individual files for the output file
DataRow = FormatEBayUploadData(Data)
'write to the file
OutputStream.WriteLine(DataRow)
RecordNumber = RecordNumber + 1
data.MoveNext
Wend
data.Close
End If
'now close the output file for this market
OutputStream.Close
lblStatus.Text = “Done…”[/code]
In the ‘old days’ with VB etc I would have used something like DoEvents to allow the form to re-paint in the loop, but I read that this is not good for Xojo.
So how do I get the visual indicators to refresh whilst processing this loop?
Thanks
Mark