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,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ede2fcfbef7f3092 X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!peer1.news.newnet.co.uk!peer1.news.newnet.co.uk!nerim.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "Marius Amado Alves" Newsgroups: comp.lang.ada Subject: Re: "out" parameters Date: Sat, 29 May 2004 00:45:10 +0100 Organization: Cuivre, Argent, Or Message-ID: References: <14098638.pGWFRt1ihv@linux1.krischik.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1085787921 63583 212.85.156.195 (28 May 2004 23:45:21 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Fri, 28 May 2004 23:45:21 +0000 (UTC) To: Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-OriginalArrivalTime: 28 May 2004 23:45:08.0190 (UTC) FILETIME=[CEEF57E0:01C4450D] X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: controlnews3.google.com comp.lang.ada:900 Date: 2004-05-29T00:45:10+01:00 > If I have a record that contains 2 fields, I initialize the 1st field, > I then pass the record as an 'out' parameter to a subprogram. The > subprogram assigns a value to the 2nd field and returns. > > If the record has neither elementary nor access type in it, then the > compiler may have the flexibility to decide how it wants to pass the > record. > > The question is, what value should I expect for the 1st field in the > record when the subprogram returns? This is defined by the language, it's not compiler-dependent. If you mean "in out" (and not just "out"), you get out whatever you passed in in any component and the subprogram did not touch. If you really mean (just) "out", well, you cannot expect to get out anything valid that the subprogram did not touch, can you? After all, you're not passing anything "in". (Well, actually you may be kind of passing something, e.g. bounds. But never field values.)