Could you give an example how to work with waitfor?

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

Could you give an example how to work with waitfor?

Postby alexhaifa » December 6th, 2005, 12:34 pm

Maybe the way I am trying to work is not correct,
I looked up in readme about waitfor

I understood so so, could you give me an example?

Assistent.StopAll;
Assistent.Play(aaDoMagic);

I should put here the code, Waitfor(aaDoMagic), something like this?

Thanks very much
alexhaifa
Junior Member
Junior Member
 
Posts: 35
Joined: November 22nd, 2005, 2:01 pm
Location: Brazil

Postby Kambiz » December 7th, 2005, 10:06 am

You code is wrong.

Each animation you request to play, places in a queue.

In the other hand, all Play functions return a RequestID for the animation you requested to play. Then, you should pass this value to WaitFor function, or Zero if you want to wait for the latest request.

For example:

Code: Select all
var
  ID: TRequestID;
begin
  ID := Assistant.Play(aaDoMagic);
  Assistant.WaitFor(ID);
end;

or this way:

Code: Select all
begin
  Assistant.Play(aaDoMagic);
  Assistant.WaitFor(0);
end;
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Products

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron