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: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: set_index and and end_of_file with just a stream reference Date: Tue, 23 Feb 2021 18:56:47 +0100 Organization: Adalog Message-ID: References: <4d2daa8c-c159-48a4-bdf7-e9aa3b537bcan@googlegroups.com> <4d0aa284-8042-4260-ac58-6d3ac9a82b00n@googlegroups.com> <1cd1f911-ab74-464a-8eff-b6f3d79bfe8an@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Tue, 23 Feb 2021 17:56:48 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="0af5a4f6e09ccc1b9b8a1e875e23f38a"; logging-data="8010"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RkyaTpNKB9CJp7/+HOnv4" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 Cancel-Lock: sha1:GbAtw8WogcSGzftBXxFIUgOhxjw= In-Reply-To: Content-Language: fr Xref: reader02.eternal-september.org comp.lang.ada:61426 List-Id: Le 20/02/2021 à 20:08, Mehdi Saada a écrit : > Okay :-) > what I wanted is: > I read an acronyme in the stream file, if good I input the adjacent record type, otherwise I would advance on the stream until the next acronyme with set_index(stream_access, index(stream_access) + composite_type_stream_size) and read the next acronyme (unbounded_string). > Now I just input both objects and verify the acronyme. > But I don't like writing an object that maybe won't be used. > Assuming: 1) the file is a text file 2) it is created with an Ada program There is a simple solution: Separate your entries (Acronym+Data) with a call to New_Page When you read an acronym that you don't want, call Skip_Page; this will put you in front of the next entry. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr