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: FRENCH,ASCII X-Google-Thread: 107e1d,20df1d18f8f75d4c X-Google-Attributes: gid107e1d,public X-Google-Thread: 103376,20df1d18f8f75d4c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-10 05:00:46 PST Message-ID: <3C3D907B.96C0B981@epfl.ch> Date: Thu, 10 Jan 2002 14:00:43 +0100 From: "Charles Fr. Rey" X-Mailer: Mozilla 4.78 [en] (X11; U; SunOS 5.8 sun4u) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada,fr.comp.lang.ada Subject: Re: =?iso-8859-1?Q?Probl=E8me?= avec des get(fichier, integer) References: Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable NNTP-Posting-Host: cosun143.epfl.ch X-Trace: epflnews.epfl.ch 1010667643 cosun143.epfl.ch (10 Jan 2002 14:00:43 +0200) Organization: EPFL Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.mailgate.org!news-zh.switch.ch!epflnews.epfl.ch Xref: archiver1.google.com comp.lang.ada:18730 fr.comp.lang.ada:1181 Date: 2002-01-10T14:00:43+01:00 List-Id: In my opinion you'd better use the predefined date & time types ... Y'a plein de fonctions et de types d=E9j=E0 pr=E9d=E9finis et comme =E7a = tu utilises un format de date "standard". Tout d=E9pends =E9videmment de l'utilisation de ton programme, mais si le format de date n'est pas impos=E9, t'as meilleur temps d'utiliser le format pr=E9d=E9fini. Benoit F wrote: > = > I'm Fench so spry for my bad english. En fran=E7ais plus bas ! > 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); <=3D here raise DATA_ERROR > end; > = > The error is because of the ':' charcater whose folow the date. If I re= place > the ':' by an other character, the procedure work ! > If sombody know the solution to make work my procedure ! > = > ------------------------------------------------------------ > French traduction > = > mon fichier contient sur une ligne : "1/12/01:12" > Elle correspond =E0 une date suivie d'un nombre d'heure > = > j'ai un 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; > = > j'ai cr=E9e la fonction > = > 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); <=3D plantage ici DATA_ERROR > end; > = > Le plantage est caus=E9 par le caract=E8re ':' qui suit la date ! > Si je mais un autre caract=E8re que ':' la procedure marche ! > = > Si quelqu'un =E0 une id=E9e, je le remercie