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,e89e4fc8b5c5f198,start X-Google-Attributes: gid103376,public From: Steve Dyrdahl Subject: get_line Date: 1998/06/05 Message-ID: #1/1 X-Deja-AN: 359886150 Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Organization: montana.edu Newsgroups: comp.lang.ada Date: 1998-06-05T00:00:00+00:00 List-Id: I have a problem that seems fairly simple. Suppose the following: type name_array is array (1..10) of string (1..15); names : name_array; length : natural; Then: for I in name_array'range loop get_line (names(I),length); end loop; The problem (on our Unix system anyway) is that if the user types more characters than the string will hold. The "leftover" characters are still left in the input buffer and will be read on the next execution of the loop. I am wondering if there is a clean solution for flushing the input buffer to avoid this problem. Obviously I could write my own version of get_line to avoid this problem, but I try to avoid reinventing the wheel whenever possible. Steve Dyrdahl