Topic: SLEEP function

Hello Dmitry,
I hope you are well.
I am trying to display a 'logo' screen for a few seconds at the start of a project.  I know how to do this using the timer function but this has always seemed a complicated way of doing something that should be quite simple.
So I am trying to use the 'sleep' function.  This correctly displays my 'logo' screen and then closes after x seconds but any object that I have placed on the 'logo' screen (label, image etc) does not appear - all that displays is the blank 'logo' screen.  Is this a bug or is there something else I need to do?
Please find attached an example of my problem.
Thanks,
Derek.

Post's attachments

Attachment icon sleep.zip 335.35 kb, 447 downloads since 2016-08-09 

Re: SLEEP function

Hi!
Try that.

Post's attachments

Attachment icon sleep.7z 2.52 kb, 437 downloads since 2016-08-09 

Re: SLEEP function

Hello Iacovlogica, Dmitry,
Thank you for your reply. 
However, my question to Dmitry is WHY can you call a form and use the 'sleep' function to display it for x seconds BUT any objects on that form are NOT shown. 
If
  logo.show;
  sleep(5000);
  logo.close;
is syntactically correct and the form is successfully opened, displayed for the correct time and then closed, I would expect any objects placed on that form to also be displayed, unless there is perhaps a bug.
Derek.

Re: SLEEP function

derek
Check out this script, jusr added line Application.ProcessMessages;

procedure Form1_OnShow (Sender: string; Action: string);
begin
  logo.show;
  Application.ProcessMessages;
  sleep(3000);
  logo.close;
end;
Dmitry.

Re: SLEEP function

Hi Dmitry,
That works great now and a much simpler way to display a logo screen rather than using ttimer etc.
Thanks,
Derek.