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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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 16:30:35 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!elnk-pas-nf1!elnk-nf2-pas!newsfeed.earthlink.net!wn54feed!worldnet.att.net!attbi_s04.POSTED!not-for-mail Message-ID: <40340453.F3DEEB92@mchsi.com> From: Bruce or Tracy Jacobs Reply-To: bruce.tracy@the-jacobs.org X-Mailer: Mozilla 4.7 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Keyboard Polling Solution References: <4033DB01.2CE34E32@me.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 12.218.74.234 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s04 1077150635 12.218.74.234 (Thu, 19 Feb 2004 00:30:35 GMT) NNTP-Posting-Date: Thu, 19 Feb 2004 00:30:35 GMT Organization: MediaCom High Speed Internet Date: Thu, 19 Feb 2004 00:30:35 GMT Xref: archiver1.google.com comp.lang.ada:5660 Date: 2004-02-19T00:30:35+00:00 List-Id: As I get deeper in to my application implementation, there is a good chance I will have to take a look into tasking. Thank you. Bruce Preben Randhol wrote: > > 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."