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,744136b4fae1ff3e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-12 01:43:32 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: rod.chapman@praxis-cs.co.uk (Rod Chapman) Newsgroups: comp.lang.ada Subject: Re: [Spark] Converting Arrays Date: 12 Mar 2003 01:43:31 -0800 Organization: http://groups.google.com/ Message-ID: References: NNTP-Posting-Host: 213.155.153.242 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1047462211 25171 127.0.0.1 (12 Mar 2003 09:43:31 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 12 Mar 2003 09:43:31 GMT Xref: archiver1.google.com comp.lang.ada:35246 Date: 2003-03-12T09:43:31+00:00 List-Id: Lutz Donnerhacke wrote in message news:... > * Rod Chapman wrote: > > A common trick in this case is to use a local, > > hidden procedure to initialise the out parameter: > > Cool idea. I read the book yesterday evening till midnight and came to the > conclusion, that I have to replace Fullpath by a large constraint array. > This was obviosly wrong. You can always switch off Spark checkings when > running into trouble. :-/ > > But how can I write the required pre conditions? > You can pass the Length of the Path parameter as an addition "in" parameter. e.g. procedure To_Fullname (S : in String; Path : out Fullname; Path_Length : in Natural); --# derives Path from S, Path_Length; --# pre S'Length < Path_Length; Then a caller simply does: To_Fullname (LS, P, P'Length); or similar. - Rod I