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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7d05ebe305483c33 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-27 06:25:27 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsxfer.interpacket.net!lnewspeer01.lnd.ops.eu.uu.net!emea.uu.net!newsfeed.siemens.de!news.mch.sbs.de!not-for-mail From: Alfred Hilscher Newsgroups: comp.lang.ada Subject: Re: Newbie question Date: Thu, 27 Dec 2001 15:25:22 +0100 Organization: Siemens AG Message-ID: <3C2B2F52.2569C5E@icn.siemens.de> References: NNTP-Posting-Host: 139.21.122.158 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:18334 Date: 2001-12-27T15:25:22+01:00 List-Id: Michal Nowak wrote: > >Hour := > > Hour_Type'Value (Whole_Line (Current_Position .. Current_Position + 2)); > ^^^^ > There was another little one. It should be Current_Position + 1 (assuming, > that hour is two digit, and Current_Position is position of first digit). Another way would be to search for the first digit and then search from there to the first non digit, so you can handle both, one-digit hours and two-digit hours: Hour := Hour_Type'Value (Whole_Line (First_Digit .. First_Non_Digit - 1));