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-7-bit X-Google-Thread: 103376,e07818d50a32cdd7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-05 05:21:53 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3B1CC1FE.304BF00E@earthlink.net> From: "Marc A. Criley" Organization: Quadrus Corporation X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Constraint error? References: <60OS6.3835$v4.183613@www.newsranger.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 05 Jun 2001 12:21:52 GMT NNTP-Posting-Host: 158.252.122.148 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 991743712 158.252.122.148 (Tue, 05 Jun 2001 05:21:52 PDT) NNTP-Posting-Date: Tue, 05 Jun 2001 05:21:52 PDT X-Received-Date: Tue, 05 Jun 2001 05:19:56 PDT (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:8141 Date: 2001-06-05T12:21:52+00:00 List-Id: Ted Dennison wrote: > > > The second way to deal with strings is to delay their declaration until you can > assign the value directly into them. That way you can leave the bounds off of > the declaration and let it size itself perfectly to the contents. This is the > easiest method to deal with, if you can use it. Most of the attributes > ('whatever) that deal with strings can be used with this method. If you want to > use this method in your own subprograms, you should endevor to always return > strings as function return values. Of course this method only works if you don't > plan on changing the contents. For example (my apologies if my newsreader hoses > the formatting): > > declare > Width_Answer : constant String := Answer (1..Answer_Length); > begin > -- work with Width_Answer in here. > .. > end; Ada 95 removed the requirement that a String declaration as used in the above example be declared _constant_. The string will be properly sized, but you can now modify it to your heart's content, just can't change the size. Marc A. Criley Senior Staff Engineer Quadrus Corporation www.quadruscorp.com