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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.albasani.net!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: A few questions Date: Tue, 3 Nov 2015 00:25:05 -0600 Organization: JSA Research & Innovation Message-ID: References: NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1446531907 16939 24.196.82.226 (3 Nov 2015 06:25:07 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 3 Nov 2015 06:25:07 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Xref: news.eternal-september.org comp.lang.ada:28186 Date: 2015-11-03T00:25:05-06:00 List-Id: "Jeffrey R. Carter" wrote in message news:n13m1a$p3c$1@dont-email.me... > On 10/31/2015 01:29 PM, Laurent wrote: >> >> I need a range of Dates. >> >> So is there an existing package which generates a range of Dates from .. >> to >> ? >> >> PS: need this range of dates because the log files I want to read and >> extract >> informations from are all named like this: vba-yyyymmdd.log where >> obviously >> yyyymmdd is the date. The program generates a new file every date an >> stores >> the communication it treated in it. >> >> I want to read this files and extract the messages which passed. Is more >> an >> exercise than actually a need to do it. > > I'm not aware of any such pkg. On the other hand, I'm not sure you need > it. Do > you really need to store all the dates in the range? You could process the > file > for date D, then the file for date D + 1, ..., until you have processed > all the > desired files. > > Conceptually the idea of an operation > > function "+" (Left : in Dates.Object; Right : in Integer) return > Dates.Object; > > makes sense; without knowing the details of the implementation of > Dates.Object I > have no idea how easy it would be. For Ada.Calendar.Time, one would simply > add > Right * Ada.Calendar.Day_Duration'Last. Or easier still, just use Ada.Calendar.Arithmetic, which has operations for adding numbers of days to a Ada.Calendar.Time (added in Ada 2005). (This is hard to do in Ada 95 if you need to add more than one day at a time.) Randy.