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-Thread: 103376,132a17fa42920218 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit From: "zork" Newsgroups: comp.lang.ada References: <412052f5$1@dnews.tpgi.com.au> Subject: Re: procedures and return Date: Mon, 16 Aug 2004 17:10:02 +1000 Organization: - X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 220.244.246.241 X-Original-NNTP-Posting-Host: 220.244.246.241 Message-ID: <41205dc4@dnews.tpgi.com.au> X-Trace: dnews.tpgi.com.au!tpg.com.au 1092640196 220.244.246.241 (16 Aug 2004 17:09:56 +1000) Path: g2news1.google.com!news1.google.com!news.glorb.com!solnet.ch!solnet.ch!nntp.gblx.net!nntp3.phx1!dnews.tpgi.com.au!tpg.com.au!not-for-mail Xref: g2news1.google.com comp.lang.ada:2749 Date: 2004-08-16T17:10:02+10:00 List-Id: Oh please disregard this post! "zork" wrote in message news:412052f5$1@dnews.tpgi.com.au... > Hi, > > 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"? > > I am using ada95. > > Any help appreciated! > > zork > >