comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: set_index and and end_of_file with just a stream reference
Date: Tue, 23 Feb 2021 18:56:47 +0100	[thread overview]
Message-ID: <s13fl0$7qa$1@dont-email.me> (raw)
In-Reply-To: <a135e4e9-9e51-4b57-ace7-f3cc930b7973n@googlegroups.com>

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

  parent reply	other threads:[~2021-02-23 17:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-20 15:26 set_index and and end_of_file with just a stream reference Mehdi Saada
2021-02-20 15:35 ` Mehdi Saada
2021-02-20 16:01   ` Simon Wright
2021-02-20 16:04 ` Dmitry A. Kazakov
2021-02-20 16:22   ` Mehdi Saada
2021-02-20 16:30     ` Mehdi Saada
2021-02-20 17:59       ` Dmitry A. Kazakov
2021-02-20 19:08         ` Mehdi Saada
2021-02-20 21:41           ` Simon Wright
2021-02-21  0:22           ` Dmitry A. Kazakov
2021-02-23 17:21           ` Shark8
2021-02-23 17:56           ` J-P. Rosen [this message]
2021-02-20 17:52     ` Dmitry A. Kazakov
2021-02-21  1:56   ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox