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 X-Google-Thread: 103376,611fb023d16b157d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-04 10:06:13 PST Newsgroups: comp.lang.ada Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news-peer.gip.net!news.gsl.net!gip.net!newsfeed.mathworks.com!portc03.blue.aol.com!uunet!dca.uu.net!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: Here my package X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=iso-8859-1 Message-ID: <3ACB4E79.6A461BC3@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 8bit Organization: The Boeing Company X-Accept-Language: en References: <0rGy6.262$A24.137061@carnaval.risq.qc.ca> Mime-Version: 1.0 Date: Wed, 4 Apr 2001 16:40:25 GMT X-Mailer: Mozilla 4.5 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: supernews.google.com comp.lang.ada:6463 Date: 2001-04-04T16:40:25+00:00 List-Id: Mich wrote: > > ok here my package and i need to create a procedure named Date_Valide > but i don't know how. my package goes like that: Actually, it looks as if you know how to create a function. Procedures are similar, but don't return a value: procedure Date_Valide is -- null; begin -- Date_Valide null; end Date_Valide; If I knew the requirements for procedure Date_Valide I could perhaps be more helpful. > PACKAGE lesdates IS > TYPE Date IS RECORD > Jour : Natural; > Mois : Natural; > Ann�e : Natural; > END RECORD; So, what does zero mean as a year? A number not in 1 .. 12 for a month? A number not in 1 .. 31 for a day? You should take a look at Ada.Calendar, and perhaps use some of the subtypes defined there: type Date is record Ann�e : Positive; Mois : Ada.Calendar.Month_Number; Jour : Ada.Calendar.Day_Number; end record; This would make validating dates much easier. Jeffrey Carter