Hi.
Reopening an old issue, haven't been playing around with it for quite a
while (rather given up), but now I would like to find a solution.
Very simple, I am trying to read a large textfile, but doing read I want
the wait cursor.
Trying to do like this, but still it seems like the process simply do
not refresh the form:
procedure tmainfo.opencsvfile(const sender: TObject);
begin
if tfiledialog1.execute(fdk_open) = mr_ok then
begin
application.beginwait;
try
AssignFile(CSVFile,tfiledialog1.controller.filename);
Reset(CSVFile);
While SeekEof(CSVFile)=false do
begin
Readln(CSVFile,CSVString);
.
.
end;
finally
application.endwait;
end;
CloseFile(CSVFile);
end;
end;
Den 27-09-2010 14:06, Christian Nobel skrev:
> Ok, tried with the finally block, still same result, namely that the
> cursor does not change.
>
> However if I do like this:
>
> if tfiledialog1.execute(fdk_open) = mr_ok then
> begin
> mainfo.cursor:=cr_Wait;
> application.beginwait;
> try
> .
> .
> then the cursor is set when the procedure terminates.
>
> and reversing the order makes no change:
>
> if tfiledialog1.execute(fdk_open) = mr_ok then
> begin
> application.beginwait;
> mainfo.cursor:=cr_Wait;
> try
> .
> .
>
> So for some reason it seems to me that the screen is not updated, as
> soon as the procedure is running?
>
> /Christian
>
>> Yes, I suggest to use a try finally block:
>> "
>> if tfiledialog1.execute(fdk_open) = mr_ok then begin
>> application.beginwait;
>> try
>> filer:=tfiledialog1.controller.filenames;
>> [...]
>> medpicstream.Free;
>> end;
>> finally
>> application.endwait;
>> end;
>> end;
>> "
>>
>> _______________________________________________
>> MSEide-MSEgui-talk mailing list
>> [email protected]
>> https://lists.berlios.de/mailman/listinfo/mseide-msegui-talk
>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk