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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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-29 13:51:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: Michal Nowak Newsgroups: comp.lang.ada Subject: Re: Newbie question Date: Sat, 29 Dec 2001 22:54:44 +0100 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: <3C2B2F52.2569C5E@icn.siemens.de> Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT X-Trace: avanie.enst.fr 1009662662 59006 137.194.161.2 (29 Dec 2001 21:51:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sat, 29 Dec 2001 21:51:02 +0000 (UTC) To: "comp.lang.ada usegroup->mailing list gateway" Return-Path: In-reply-to: <3C2B2F52.2569C5E@icn.siemens.de> X-Mailer: Calypso Version 3.20.01.01 (3) Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.6 Precedence: bulk X-Reply-To: vinnie@inetia.pl List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:18391 Date: 2001-12-29T22:54:44+01:00 On 01-12-27 at 15:25 Alfred Hilscher wrote: >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)); I just wanted the simplest way and was still thinking in terms of C-style strings (if they exist). Today's morning in the bed I passed chapter 5 of Cohen's book (String handling). Yea, Find_Token should do the trick. Mike