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=-0.1 required=5.0 tests=AXB_XMAILER_MIMEOLE_OL_024C2, BAYES_00,MAILING_LIST_MULTI,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,228dbf2f126edf08 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-19 07:16:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!colt.net!newspeer.clara.net!news.clara.net!oleane.net!oleane!teaser.fr!enst!enst.fr!not-for-mail From: Newsgroups: comp.lang.ada Subject: Re: ADA and return functions (Strings) Date: Mon, 20 May 2002 00:14:59 +1000 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: <3ce75220@news.comindico.com.au> Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1021817762 40168 137.194.161.2 (19 May 2002 14:16:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sun, 19 May 2002 14:16:02 +0000 (UTC) Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.8 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:24375 Date: 2002-05-20T00:14:59+10:00 Thank you very much David... ----- Original Message ----- From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada Sent: Sunday, May 19, 2002 8:38 PM Subject: Re: ADA and return functions (Strings) > > ----- Original Message ----- > From: "ProLogic" > Newsgroups: comp.lang.ada > To: > Sent: May 19, 2002 2:20 AM > Subject: ADA and return functions (Strings) > > > > Why does ADA return extra spaces in for example the following function... > > > > function getVersion return String is > > begin > > return Version.Major'img & "." & Version.Minor'img; > > end; > Well, ADA doesn't return anyting, but the Ada function you've supplied > above will return a string with spaces because the Image attributes of > non-negative numeric objects is defined with a leading space where the > '-' would be if the object had a negative value. This is true even for > types that are declared not to have negative values. > > The best way to do this without spaces is something like this: > > return Ada.Strings.Fixed.Trim (Version.Major'img, Ada.Strings.Left) & > "." & Ada.Strings.Fixed.Trim (Version.Minor'img, Ada.Strings.Left); > > > >