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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,132a17fa42920218 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews2.google.com!not-for-mail From: gautier_niouzes@hotmail.com (Gautier) Newsgroups: comp.lang.ada Subject: Re: procedures and return Date: 16 Aug 2004 04:03:18 -0700 Organization: http://groups.google.com Message-ID: <17cd177c.0408160303.6b0a6366@posting.google.com> References: <412052f5$1@dnews.tpgi.com.au> NNTP-Posting-Host: 213.173.163.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1092654199 26849 127.0.0.1 (16 Aug 2004 11:03:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 16 Aug 2004 11:03:19 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:2751 Date: 2004-08-16T04:03:18-07:00 List-Id: zork: > I am a little confused about how precedures handle a 'return' statement. I > have the following: > > procedure my_procedure (...) > begin > if then > put("inside if-statement); > new_line; > return; > end if; > put ("outside if-statement"); > end my_procedure; > > I am finding that if some_condition *is* satisfied, then the procedure > prints both put statements i.e. > > inside if-statement > outside if-statement > > ... i thought 'return' should exit the procedure and return control to where > the procedure was called. hence only printing "inside if-statement"? Aren't you calling 'my_procedure' twice, once with = True, then once with = False ? ________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/gsoft.htm NB: For a direct answer, e-mail address on the Web site!