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,20df1d18f8f75d4c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-03 07:48:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "M. A. Alves" Newsgroups: comp.lang.ada Subject: =?ISO-8859-1?Q?Re=3A_Probl=E8me_avec_des_get=28fichier=2C_integ?= =?ISO-8859-1?Q?er=29?= Date: Thu, 3 Jan 2002 15:47:36 +0000 (GMT) Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: 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 X-Trace: avanie.enst.fr 1010072882 59761 137.194.161.2 (3 Jan 2002 15:48:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Thu, 3 Jan 2002 15:48:02 +0000 (UTC) To: Return-Path: X-X-Sender: In-Reply-To: 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 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:18481 Date: 2002-01-03T15:47:36+00:00 On Wed, 2 Jan 2002, Benoit F wrote: > I've the line "1/12/01:12" in a file, This line is a french date > (day/month/year) with an hour > > I've got the following type date : > subtype tjours is positive range 1..31; > subtype tmois is positive range 1..12; > subtype tans is positive range 1..99; > > type TDate is record > J:tjours; > M:tmois; > A:tans; > end record; > > I wrote this procedure > > procedure Get (F: in File_Type; D: out TDate) is > -- Entree d'une date a partir du fichier > Slash : Character; > begin > Get (F,D.J); > Get (F,Slash); > Get (F,D.M); > Get (F,Slash); > Get (F,D.A); <= here raise DATA_ERROR > end; > > The error is because of the ':' charcater whose folow the date. If I replace > the ':' by an other character, the procedure work ! Seems like a GNAT bug to me. > If sombody know the solution to make work my procedure ! The obvious workaround is to clean the line e.g. read the line to a string S and make the Get from the slice S(1 .. N) where N is the position of the ':'. -- , M A R I O data miner, LIACC, room 221 tel 351+226078830, ext 121 A M A D O Rua Campo Alegre, 823 fax 351+226003654 A L V E S P-4150-180 PORTO, Portugal mob 351+939354002