From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: questions on input/output Date: Sat, 6 Feb 2021 00:36:25 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 5 Feb 2021 23:36:26 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="c40bafc43bb5be82ea9fc176b14c9339"; logging-data="8111"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+yHFuuxRddUVuFCtdNTr5JJkGZpFvXlBs=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 Cancel-Lock: sha1:qQakYDGIoKQj+6/ehy99J9AicVw= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:61290 List-Id: On 2/5/21 11:50 PM, Mehdi Saada wrote: > I can't understand how input/output works. > 1) on text files - not keyboard input - what's the difference between get_immediate and get ? Get_Immediate might behave differently at a line terminator. > 2) what means "consumming" characters, if indices don't change ? It is usually best to only use Get_Immediate with Standard_Input, and to ignore the column, line, and page counting and setting operations. > 3) can set_col be used or not, to go back in a line in an IN_FILE file ? You cannot go back in a text file. Only Direct_IO and Stream_IO support this. > I need: to read a character, until some marker, then go back (set_col(stored_position)) and read again but store it like Get(variable, FILE); then go past the marker (set_col(FILE,col(file)+1)). You will probably want to store the characters that you read in a string and obtain the value from it. -- Jeff Carter "I wave my private parts at your aunties." Monty Python & the Holy Grail 13