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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.31.134.2 with SMTP id i2mr12038444vkd.8.1446323391391; Sat, 31 Oct 2015 13:29:51 -0700 (PDT) X-Received: by 10.182.24.226 with SMTP id x2mr154886obf.8.1446323391353; Sat, 31 Oct 2015 13:29:51 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!c107no3757477qgd.1!news-out.google.com!z4ni42116ign.0!nntp.google.com!i2no1259107igv.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 31 Oct 2015 13:29:51 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2001:7e8:d039:4f01:a475:9305:c952:acec; posting-account=sDyr7QoAAAA7hiaifqt-gaKY2K7OZ8RQ NNTP-Posting-Host: 2001:7e8:d039:4f01:a475:9305:c952:acec User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: A few questions From: Laurent Injection-Date: Sat, 31 Oct 2015 20:29:51 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2901 X-Received-Body-CRC: 1059353838 Xref: news.eternal-september.org comp.lang.ada:28152 Date: 2015-10-31T13:29:51-07:00 List-Id: Hi I need a range of Dates. So I tried this: Begin_Date: Dates.Object;=20 End_Date: Dates.Object; -- Dates is a package from an earlier example in my Ada95 book. It is based= on Ada.Calendars. I prefer to use -- Dates because I actually need only the date, I don't care/ need the hour= . I also find the name "Time" for=20 -- something like "2015/10/31 21:00:00" confusing but that's just my opinio= n. That doesn't work unfortunately and the compiler is right to complain: subtype Period is range Begin_Date .. End_Date; I naively thought that it could be so easy. I could solve this problem with a few loops and filling an array or a list = with the generated dates but the loop thing will be probably very ugly/comp= licated.=20 For the array I also have to know how many dates I actually have between Be= gin_Date and End_Date. I have tried to=20 I have found in Ada.Calendar a: function "-" (L,R:Time) return Duration Is it possible to make a casting to convert my Date type in (Ada.Calendar) = Time type: Today : Ada.Calendar.Time:=3D Time(Date); -- or something like that. I could of course use the Getters from Dates and then construct a new Time.= More of curiosity than an actual problem. Well of course I could simply use Ada.Calendar. So is there an existing package which generates a range of Dates from .. to= ? Feels like cheating but causes less frustration.=20 Thanks Laurent PS: need this range of dates because the log files I want to read and extra= ct informations from are all named like this: vba-yyyymmdd.log where obviou= sly yyyymmdd is the date. The program generates a new file every date an st= ores 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.