why this is not allowed? 
Author Message
 why this is not allowed?

Hi,

Anybody knows why this code is not allowed both in GNAt and Aonix

select
  ...
  ...
  ...
or
  delay 5.0;
or
  delay until SOME_TIME;
end select;

I carefuly examined available documentation and didn't found

any word on above construction

Thanks in advance
Michal



Sat, 23 Nov 2002 03:00:00 GMT  
 why this is not allowed?


Quote:
> Anybody knows why this code is not allowed both in GNAt and Aonix

> select
>   ...
>   ...
>   ...
> or
>   delay 5.0;
> or
>   delay until SOME_TIME;
> end select;

Because you are only allowed one delay alternative.

Probably your best bet is going to be to delay until the minimum of
SOME_TIME and Ada.Calendar.Clock + 5.0. If you need to know which it
was, you might have a bit more work.

--
T.E.D.

http://www.telepath.com/~dennison/Ted/TED.html

Sent via Deja.com http://www.deja.com/
Before you buy.



Sat, 23 Nov 2002 03:00:00 GMT  
 why this is not allowed?

Quote:



> > Anybody knows why this code is not allowed both in GNAt and Aonix

> > select
> >   ...
> >   ...
> >   ...
> > or
> >   delay 5.0;
> > or
> >   delay until SOME_TIME;
> > end select;

> Because you are only allowed one delay alternative.

No, you are allowed multiple delay alternatives (presuming
we are talking about selective accept statements rather
than selective entry calls).  However, per RM95-9.7.1(13), they
must all be the same "kind" of delay alternative -- all relative
or all absolute (delay until), and if absolute, all the same time
"base" (all Calendar or all Real_Time).

Quote:

> Probably your best bet is going to be to delay until the minimum of
> SOME_TIME and Ada.Calendar.Clock + 5.0. If you need to know which it
> was, you might have a bit more work.

This will certainly work, as will:

   or
      delay until Ada.Calendar.Clock + 5.0;
   or
      delay until Some_Time;
   ...

presuming Some_Time is of type Ada.Calendar.Time.

Quote:

> --
> T.E.D.

--

Technical Director, Commercial Division, AverStar (formerly Intermetrics)
(http://www.averstar.com/services/IT_consulting.html)  Burlington, MA  USA


Sat, 23 Nov 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. why text entry does not allow Capitalized Case?

2. Why not allow define after begin?

3. Why recursion not allowed

4. Why does Tcl not allow +1?

5. Why I am not enthusiatic about OO COBOL

6. Why I am not reaching callbacks ?

7. NOT Allow Inserts not working

8. I am not deaf, but am I mute?

9. why import * only allowed at module level?

10. Enterprise Edition - Why/Why not???

11. Why (or why not) one module per file?

12. why TCL and why not TCL with JAVA

 

 
Powered by phpBB® Forum Software