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,7be3870dd9c9518f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-19 12:56:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: CONSTRAINT_ERROR - why? Date: Thu, 19 Dec 2002 14:57:13 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <3DFB7841.F898C02@t-online.de> <3DFB8495.A655C512@t-online.de> <616gta.hk3.ln@beastie.ix.netcom.com> <3DFC878D.B6966C37@t-online.de> <2a9jta.1p3.ln@beastie.ix.netcom.com> <3DFD38A7.6080204@acm.org> <3DFE1FFB.E1BB660E@t-online.de> <3DFF6AFB.A536A0CE@t-online.de> <3E00C040.A038AFCE@t-online.de> <3E01F897.20404@psu.edu> X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MIMEOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:32096 Date: 2002-12-19T14:57:13-06:00 List-Id: Robert Spooner wrote in message <3E01F897.20404@psu.edu>... >Another way is to use the Max_Size_In_Storage_Elements attribute. In general, that could be dangerous, at least when writing to the object. Because that is the maximum number of bytes that could ever for some object of the subtype, and nothing requires compilers to make it accurate. Storage_Elements.Storage_Count'Last is always a correct response for this attribute (and in some cases, the only possible response). Also, if the object is stored in multiple parts, it might actually be bigger than than this value. So this value could be larger than the actual object. Obj'Size is the safest way to find out, but then you must take care to round properly, etc. Randy.