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,45c857e19c4ee2df X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-27 13:41:06 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "Beard, Frank" Newsgroups: comp.lang.ada Subject: RE: Ada95 calendar package question Date: Wed, 27 Jun 2001 16:39:35 -0400 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="iso-8859-1" X-Trace: avanie.enst.fr 993674465 47747 137.194.161.2 (27 Jun 2001 20:41:05 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 27 Jun 2001 20:41:05 +0000 (UTC) To: "'comp.lang.ada@ada.eu.org'" Return-Path: X-Mailer: Internet Mail Service (5.5.2448.0) Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.4 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:9162 Date: 2001-06-27T16:39:35-04:00 -----Original Message----- From: James Rogers [mailto:jimmaureenrogers@worldnet.att.net] > Converting month numbers to month names is simple. Create an enumerated > type containing the month names you want, then convert the > Ada.Calendar.Month_Number to the corresponding month name: > > type months is (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, > Oct, Nov, Dec); > Month_Name : Months := Months'Val(Ada.Calendar.Month(Time_Value)); Except that Ada.Calendar.Month returns a number in the range of 1 to 12, while 'POS and 'VAL for type months works on values in the range of 0 to 11. So, you would have to do something like the following: Month_Name : Months := Months'Val(Ada.Calendar.Month(Time_Value) - 1); But that would probably cause CONSTRAINT_ERROR in January, so you end up with: Month_Name : Months := Months'Val(natural(Ada.Calendar.Month(Time_Value)) - 1); Frank