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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no 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 09:04:04 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!128.230.129.106!news.maxwell.syr.edu!sunqbc.risq.qc.ca!carnaval.risq.qc.ca.POSTED!not-for-mail From: "Mich" Newsgroups: comp.lang.ada References: <0rGy6.262$A24.137061@carnaval.risq.qc.ca> <9afek0$cnp$1@nh.pace.co.uk> Subject: Re: Here my package X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Wed, 04 Apr 2001 15:57:40 GMT NNTP-Posting-Host: 24.226.171.64 X-Complaints-To: abuse@cgocable.ca X-Trace: carnaval.risq.qc.ca 986399860 24.226.171.64 (Wed, 04 Apr 2001 11:57:40 EDT) NNTP-Posting-Date: Wed, 04 Apr 2001 11:57:40 EDT Xref: supernews.google.com comp.lang.ada:6456 Date: 2001-04-04T15:57:40+00:00 List-Id: the procedure need to be in the package 'cause in my principal program i will call the Date_Valide "Marin David Condic" a �crit dans le message news: 9afek0$cnp$1@nh.pace.co.uk... > Now you're getting somewhere. What is it you don't know how to do? > > To use the package in your procedure, you simply need to bring it in with a > context clause. Try this: > > with LesDates ; > use LesDates ; > procedure Date_Valide is > begin > -- Your code here. You can call all your package > -- functions by name here as if they were declared > -- locally. > end Date_Valide ; > > If you need something else, you'll have to explain what it is you need in > more detail. > > MDC > -- > Marin David Condic > Senior Software Engineer > Pace Micro Technology Americas www.pacemicro.com > Enabling the digital revolution > e-Mail: marin.condic@pacemicro.com > Web: http://www.mcondic.com/ > > "Mich" wrote in message > news:hCGy6.263$A24.139307@carnaval.risq.qc.ca... > > 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: > > > > PACKAGE lesdates IS > > TYPE Date IS RECORD > > Jour : Natural; > > Mois : Natural; > > Ann�e : Natural; > > END RECORD; > > FUNCTION Bissextile(Ann�e : IN Natural) RETURN Boolean ; > > FUNCTION Jour_Max(Mois, Annee: IN Natural) RETURN Natural ; > > FUNCTION Jour_De(La_Date : IN Date)RETURN Natural ; > > FUNCTION Prem_Jour(An : IN Natural) RETURN Natural ; > > END lesdates; > > > > ans my package body here: > > > > PACKAGE BODY lesdates IS > > --PROCEDURE Date_Valide IS > > FUNCTION Bissextile(Ann�e : IN Natural) RETURN Boolean IS > > BEGIN -- Bissextile > > IF (Ann�e REM 100) = 0 THEN > > -- un si�cle est bissextile s'il est divisible par 4 > > RETURN (Ann�e REM 400) = 0; > > ELSE > > -- une ann�e ordinaire est bissextile si elle est divisible par 4 > > RETURN (Ann�e REM 4) = 0; > > END IF; > > END Bissextile; > > > > FUNCTION Jour_Max(Mois, Annee: IN Natural) RETURN Natural IS > > -- retourne le nombre de jours maximum dans un mois > > -- Gabrini p. 131 > > BEGIN -- Jour_Max > > CASE Mois IS > > WHEN 1 | 3 | 5 | 7 | 8 | 10 | 12 => RETURN 31; > > WHEN 4 | 6 | 9 | 11 => RETURN 30; > > WHEN 2 => IF Bissextile (Annee) THEN > > RETURN 29; > > ELSE > > RETURN 28; -- merci Auguste Cesar > > END IF; > > WHEN OTHERS => RETURN 0; > > END CASE; > > END Jour_Max; > > > > FUNCTION Prem_Jour(An : IN Natural) RETURN Natural IS > > -- Retourne le premier jour de l'ann�e (dim = 0, ... , sam = 6) > > -- Valide en France � partir de 1583, en Angleterre � partir de 1752, > > -- en Russie � partir de 1918, en Gr�ce � partir de 1923 > > -- Ant�c�dent : An est une ann�e valide > > -- Cons�quent : Prem_Jour est le premier jour de l'ann�e > > > > Somme : Natural; > > BEGIN -- Prem_Jour > > Somme := An + ((An - 1) / 4) - ((An - 1) / 100) + ((An - 1) / 400); > > RETURN Somme REM 7; > > END Prem_Jour; > > > > FUNCTION Jour_De(La_Date : IN Date)RETURN Natural IS > > -- Retourne le jour de semaine de la date (Jour, Mois, An) > > -- Ant�c�dent : la date est une date valide du calendrier gr�gorien > > -- Cons�quent : Jour_De est le jour de la semaine de la date > > -- dim = 0, ... , sam = 6 > > Jour_Preced : ARRAY (1..12) OF Natural := > > (0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, > 334); > > Somme : Natural; > > > > BEGIN -- Jour_De > > > > Somme := Prem_Jour(La_Date.Ann�e) + Jour_Preced(La_Date.Mois) > > + (La_date.Jour - 1); > > -- correction pour les ann�es bissextiles > > IF Bissextile(La_Date.Ann�e) AND (La_Date.Mois > 2) THEN > > Somme := Somme +1; > > END IF; > > RETURN Somme REM 7; > > END Jour_De; > > --END Date_Valide; > > END lesdates; > > > > "Ted Dennison" a �crit dans le message news: > > JsGy6.1512$jz.128569@www.newsranger.com... > > > In article <0rGy6.262$A24.137061@carnaval.risq.qc.ca>, Mich says... > > > > > > > >i want to know how to create a procedure named Date_Valide with the > three > > > >functions in my package. > > > > > > Could you at try reposting it as plain text, rather than an attachement? > > My > > > newsreader doesn't decode binary attachements. > > > > > > --- > > > T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html > > > home email - mailto:dennison@telepath.com > > > > > >