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: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.glorb.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Is there an easier way for this? Date: Sun, 21 Jun 2015 12:25:36 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <9894cde7-2cf8-4060-be65-857812ad7b09@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Sun, 21 Jun 2015 19:24:18 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="a3855fbfe1a666be9aefba0563039ed5"; logging-data="4724"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19eagr7jB8xdR6B/Avrmxv+aOlHFtGUrNM=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <9894cde7-2cf8-4060-be65-857812ad7b09@googlegroups.com> Cancel-Lock: sha1:7saOpdT7KD6CvLrjhVRP/JYHvu4= Xref: number.nntp.giganews.com comp.lang.ada:193709 Date: 2015-06-21T12:25:36-07:00 List-Id: On 06/21/2015 11:38 AM, Laurent wrote: > > I need a function which generates some specific file names: > > VITEK2-BCI_yymmdd_hhmmss_x.txt > > where yymmdd is the current date, hhmmss the current time and x the number of txt files. No idea if x > actually important. You could do Year : Ada.Calendar.Year_Number; Month : Ada.Calendar.Month_Number; Day : Ada.Calendar.Day_Number; Hour : PragmARC.Date_Handler.Hour_Number; Minute : PragmARC.Date_Handler.Minute_Number; Seconds : PragmARC.Date_Handler.Minute_Duration; PragmARC.Date_Handler.Split (Year => Year, Month => Month, Day => Day, Hour => Hour, Minute => Minute, Seconds => Seconds); "VITEK2-BCI_" & PragmARC.Date_Handler.Year_Image_Short (Year) & PragmARC.Date_Handler.Month_Image_Numeric (Month) & PragmARC.Date_Handler.Day_Image (Day) & '_' & PragmARC.Date_Handler.Hour_Image_24 (Hour) & PragmARC.Date_Handler.Minute_Image (Minute) & PragmARC.Date_Handler.Seconds_Image (Seconds) & '_' & PragmARC.Images.Image (How_Many) & ".txt"; The PragmAda Reusable Components are at https://pragmada.x10hosting.com/pragmarc.htm -- Jeff Carter "Brave Sir Robin ran away." Monty Python and the Holy Grail 59