From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e759c9142eba3ec1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-18 15:10:55 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!green.octanews.net!news-out.octanews.net!news-out.visi.com!petbe.visi.com!news.octanews.net!news.tele.dk!news.tele.dk!small.news.tele.dk!uninett.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Keyboard Polling Solution Date: Wed, 18 Feb 2004 23:10:54 +0000 (UTC) Organization: PVV Message-ID: References: <4033DB01.2CE34E32@me.org> NNTP-Posting-Host: k-083152.nt.ntnu.no X-Trace: tyfon.itea.ntnu.no 1077145854 1685 129.241.83.152 (18 Feb 2004 23:10:54 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Wed, 18 Feb 2004 23:10:54 +0000 (UTC) User-Agent: slrn/0.9.8.0 (Linux) Xref: archiver1.google.com comp.lang.ada:5659 Date: 2004-02-18T23:10:54+00:00 List-Id: On 2004-02-18, Me wrote: > Yes, "Get_Immediate" seems to do the trick. Thanks for the tip. > > Test Example : > > > > > with Text_IO; use Text_IO; > > procedure Test is > > My_Char : CHARACTER := ' '; > Character_Exists : BOOLEAN := FALSE; > Loop_Counter : INTEGER := 0; > > procedure Take_A_Break is begin put_line ("Taking a break from > polling..."); end Take_A_Break; > > begin > > loop > Loop_Counter := Loop_Counter + 1; > for X in 1..10000 loop > Get_Immediate (Item => My_Char, > Available => Character_Exists); > if (Character_Exists) then > put_line ("Character entered. Done."); > return; > end if; > end loop; > Take_A_Break; > end loop; > > end; > > Hmm, to me this looks like you want to read about tasks in Ada. -- "Saving keystrokes is the job of the text editor, not the programming language."