From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!mRBVMlGoFUnDsRgMYRJiSw.user.46.165.242.75.POSTED!not-for-mail From: Richard Iswara Newsgroups: comp.lang.ada Subject: Get_Line skip input Date: Thu, 26 Aug 2021 12:36:18 +0700 Organization: Aioe.org NNTP Server Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: gioia.aioe.org; logging-data="3936"; posting-host="mRBVMlGoFUnDsRgMYRJiSw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US X-Mozilla-News-Host: snews://nntp.aioe.org:563 Xref: reader02.eternal-september.org comp.lang.ada:62540 List-Id: Why do Get_Line skipped the input? I have the following code: -- late declaration of Key words string array declare type Kw_Array is array (1 .. Kw_Numbers) of String (1 .. 10); Key_Words : Kw_Array; type W_Len_Array is array (1 .. Kw_Numbers) of Natural; W_Len, Multiplier : W_Len_Array; begin Ada.Text_IO.Put_Line ("Enter keywords less than 10 characters."); for i in 1 .. Kw_Numbers loop Ada.Text_IO.Put ("Keywords number "); Ada.Integer_Text_IO.Put (i, 1); Ada.Text_IO.Put (" = "); + Ada.Text_IO.Get_Line (Key_Words (i), W_Len (i)); > Ada.Text_IO.Put("Enter multiplier for keyword "); > Ada.Integer_Text_IO.Get(Multiplier(i),1); Ada.Text_IO.New_Line; end loop; end; Before I put the two lines marked above, the executable only skipped the first instance of keyword entry. After I put those two lines, the executable completely skipped the Get_Line part. So on the terminal it shows like this: Keywords number 1 = Enter Multiplier for keyword Keywords number 2 = Enter Multiplier for keyword If I modifies the line marked + into Get (Key_Words (i) (1..W_Len(i))) the compiler complain I did not assign W_Len. Most likely I get the syntax incorrect. What do I do wrong on the original code?