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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,df5a27b6159d7882,start X-Google-Attributes: gid103376,public From: smoore@chowgar.demon.co.uk (Simon Moore) Subject: Strange problem in GNAT 3.04 Win 95 Date: 1996/10/24 Message-ID: <32707cd0.8077937@news.demon.co.uk>#1/1 X-Deja-AN: 191757032 x-nntp-posting-host: chowgar.demon.co.uk content-type: text/plain; charset=us-ascii organization: j%nki~w�RJ3M-26XPLZ8L-BFGD44CT-1EA6BC82 mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-10-24T00:00:00+00:00 List-Id: Hello all If anybody has got the time could they please take a look at the listing below. The code seems syntactically and semantically correct but doesn't perform as it should. When 2 is selected you don't get the chance to input a character although option 1 works fine. But, if you un-coment the get(c) before the case statement the program works fine. It doesn't bother with that get(c) but the one inside the case statement does. Any ideas? -- ** Program listing ** -- with gnat.io; use gnat.io; procedure t1 is choice: INTEGER; n: NATURAL; c: CHARACTER; quitflag: BOOLEAN:= FALSE; BEGIN WHILE quitflag= FALSE LOOP NEW_LINE; PUT_LINE("Select an option"); PUT_LINE("****************"); PUT_LINE("1 - Get a natural"); PUT_LINE("2 - Get a character"); PUT_LINE("3 - Nothing"); PUT_LINE("4 - Nothing"); NEW_LINE; PUT_LINE("0 - Exit"); GET(choice); -- ** GET(c); -- THIS IS THE IMPORTANT LINE CASE choice IS WHEN 1 => PUT_LINE("Selection 1"); GET(n); PUT(n); PUT_LINE(" was entered"); PUT_LINE("~~~~~~~"); WHEN 2 => PUT_LINE("Selection 2"); GET(c); PUT(c); PUT_LINE(" was entered"); PUT_LINE("~~~~~~~"); WHEN 3 => PUT_LINE("Selection 3"); PUT_LINE("~~~~~~~"); WHEN 4 => PUT_LINE("Selection 4"); PUT_LINE("~~~~~~~"); WHEN 0 => quitflag:= TRUE; WHEN others => PUT("Invalid entry"); END CASE; END LOOP; END t1; ***************************************************************************** * Simon Moore - smoore@chowgar.demon.co.uk - http://www.chowgar.demon.co.uk * *****************************************************************************