Mark Rutten a �crit dans le message <34989E2A.93EF7271@dsto.defence.gov.au>... > > >The code that I have at the moment looks like > > while Execute'Count /= 0 loop > > accept Execute( In_Msg: in Message_Typ ) do > Msg := In_Msg; > end Execute; > > Add_Msg(Msg); > > end loop; > > Execute_Stuff; > > >What I'm trying to do is extract anything that's queued up >on the entry point and then go off and do something else. > >Is there a neater way of doing this? I don't want to use another >task to do either Add_Msg or Execute_Stuff. As Ben pointed out, the 'Count attribute is not the proper way to do this, although you can find examples of it in some very famous books about Ada tasking... It is surprising to see how often people write this, while there is a perfect way of checking if a rendezvous can be accepted: an else part in a select statement. Your code should be: loop select accept Execute( In_Msg: in Message_Typ ) do Msg := In_Msg; end Execute; Add_Msg(Msg); else exit; end select; end loop; Execute_Stuff;