comp.lang.ada
 help / color / mirror / Atom feed
* select ... or delay ... end select
@ 2000-10-20  0:00 Alejandro Villanueva
  2000-10-20  0:00 ` Alejandro Villanueva
  2000-10-21  0:00 ` Robert Dewar
  0 siblings, 2 replies; 4+ messages in thread
From: Alejandro Villanueva @ 2000-10-20  0:00 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

Dear Sirs,

Maybe I'm more stupid that I think I am but... why doesn't this code
work???


--
------------------------------------------------------
�Quieres Cobrar por Navegar en Internet?
Visita: http://www.navegana.com/dinero/flintstone.html
------------------------------------------------------
Alejandro Villanueva
190921@cepsz.unizar.es
------------------------------------------------------



[-- Attachment #2: condition.adb --]
[-- Type: text/plain, Size: 368 bytes --]

with Text_IO; use Text_IO;
procedure Condition is
   US: String (1..1);
   UI: Integer;
   task Wait is
      entry Ok;
   end Wait;
   task body Wait is
   begin
      Get_Line (US, UI);
      accept Ok;
   end Wait;
begin
   select
      Wait.Ok;
      Put_Line ("True");
   or
      delay Duration (1.0);
      Put_Line ("False");
   end select;
end Condition;
   

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: select ... or delay ... end select
  2000-10-20  0:00 select ... or delay ... end select Alejandro Villanueva
@ 2000-10-20  0:00 ` Alejandro Villanueva
  2000-10-21  0:00 ` Robert Dewar
  1 sibling, 0 replies; 4+ messages in thread
From: Alejandro Villanueva @ 2000-10-20  0:00 UTC (permalink / raw)


Dumb!!!!! That Get_Line was blocking!!!! Dumb!!!!!!!!


Alejandro Villanueva wrote:

> Dear Sirs,
>
> Maybe I'm more stupid that I think I am but... why doesn't this code
> work???
>
> --
> ------------------------------------------------------
> �Quieres Cobrar por Navegar en Internet?
> Visita: http://www.navegana.com/dinero/flintstone.html
> ------------------------------------------------------
> Alejandro Villanueva
> 190921@cepsz.unizar.es
> ------------------------------------------------------
>
>   ------------------------------------------------------------------------
> with Text_IO; use Text_IO;
> procedure Condition is
>    US: String (1..1);
>    UI: Integer;
>    task Wait is
>       entry Ok;
>    end Wait;
>    task body Wait is
>    begin
>       Get_Line (US, UI);
>       accept Ok;
>    end Wait;
> begin
>    select
>       Wait.Ok;
>       Put_Line ("True");
>    or
>       delay Duration (1.0);
>       Put_Line ("False");
>    end select;
> end Condition;
>

--
------------------------------------------------------
�Quieres Cobrar por Navegar en Internet?
Visita: http://www.navegana.com/dinero/flintstone.html
------------------------------------------------------
Alejandro Villanueva
190921@cepsz.unizar.es
------------------------------------------------------







^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: select ... or delay ... end select
  2000-10-20  0:00 select ... or delay ... end select Alejandro Villanueva
  2000-10-20  0:00 ` Alejandro Villanueva
@ 2000-10-21  0:00 ` Robert Dewar
  2000-10-23  0:00   ` Alejandro Villanueva
  1 sibling, 1 reply; 4+ messages in thread
From: Robert Dewar @ 2000-10-21  0:00 UTC (permalink / raw)


In article <39F06DC0.55772F5B@cepsz.unizar.es>,
  Alejandro Villanueva <190921@cepsz.unizar.es> wrote:
> This is a multi-part message in MIME format.
> --------------2E663FC7BA08114320D37981
> Content-Type: text/plain; charset=iso-8859-1
> Content-Transfer-Encoding: 8bit
>
> Dear Sirs,
>
> Maybe I'm more stupid that I think I am but... why doesn't

this code
> work???

Well it does work, it does EXACTLY what you have asked it to do
and what I would expect it to do.

To answer your question, I have to guess what misconception is
causing you to expect the wrong thing, or perhaps to guess what
compiler you are using that does something wrong with it.

When you make a bug report *anywhere* ALWAYS say exactly what
you saw, and why you think it is wrong, or why it is not what
you expect. Otherwise we are playing guessing games.

And most likely the misconception is nothing to do with
being "stupid", but rather with either misunderstanding some
Ada concept, or not noticing an obvious bug. We can help with
either problem, but we are not mind readers :-)


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




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: select ... or delay ... end select
  2000-10-21  0:00 ` Robert Dewar
@ 2000-10-23  0:00   ` Alejandro Villanueva
  0 siblings, 0 replies; 4+ messages in thread
From: Alejandro Villanueva @ 2000-10-23  0:00 UTC (permalink / raw)


Robert Dewar wrote:

> In article <39F06DC0.55772F5B@cepsz.unizar.es>,
>   Alejandro Villanueva <190921@cepsz.unizar.es> wrote:
> > This is a multi-part message in MIME format.
> > --------------2E663FC7BA08114320D37981
> > Content-Type: text/plain; charset=iso-8859-1
> > Content-Transfer-Encoding: 8bit
> >
> > Dear Sirs,
> >
> > Maybe I'm more stupid that I think I am but... why doesn't
>
> this code
> > work???
>
> Well it does work, it does EXACTLY what you have asked it to do
> and what I would expect it to do.
>
> To answer your question, I have to guess what misconception is
> causing you to expect the wrong thing, or perhaps to guess what
> compiler you are using that does something wrong with it.
>
> When you make a bug report *anywhere* ALWAYS say exactly what
> you saw, and why you think it is wrong, or why it is not what
> you expect. Otherwise we are playing guessing games.
>
> And most likely the misconception is nothing to do with
> being "stupid", but rather with either misunderstanding some
> Ada concept, or not noticing an obvious bug. We can help with
> either problem, but we are not mind readers :-)
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

Well, once more you are right. You cannot read minds. This is what I
expected it to do:
I wanted to get a user's answer to some question. If the answer were not
ready in *one* second the put FALSE, else put TRUE.
Excuse me, but I thought it would be rather obvious...

--
------------------------------------------------------
�Quieres Cobrar por Navegar en Internet?
Visita: http://www.navegana.com/dinero/flintstone.html
------------------------------------------------------
Alejandro Villanueva
190921@cepsz.unizar.es
------------------------------------------------------







^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-10-23  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-20  0:00 select ... or delay ... end select Alejandro Villanueva
2000-10-20  0:00 ` Alejandro Villanueva
2000-10-21  0:00 ` Robert Dewar
2000-10-23  0:00   ` Alejandro Villanueva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox