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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bu.edu!inmet!wayne From: wayne@inmet.inmet.com Newsgroups: comp.lang.ada Subject: Re: ADA Compiler Query Message-ID: <20600081@inmet> Date: 13 Feb 91 15:27:00 GMT References: <5574@baird.cs.strath.ac.uk> Nf-ID: #R:baird.cs.strath.ac.uk:5574:inmet:20600081:000:1042 Nf-From: inmet.inmet.com!wayne Feb 13 10:27:00 1991 List-Id: The compiler actions are well defined. According to the LRM (section 6.2:6) for a scalar parameter (integers, etc) of mode IN OUT the value of the formal parameter, variable2, is a copy of the actual parameter, variable1 and it in this case it should have the value of 10. At the end of GET_RESULT variable1 will be updated from variable2. Mode IN OUT is not "call by reference" for scalar types. 1 procedure MAIN is 2 variable1 : integer; 3 result : integer; 4 ---------------------------------------------------- 5 procedure GET_RESULT(variable2: in out integer) is 6 begin 7 variable1 := 2; 8 variable2 := variable1 + variable2; 9 end GET_RESULT; 10 ---------------------------------------------------- 11 begin 12 variable1 := 10; 13 get_result(variable1); 14 end MAIN; So at line 6 both variable1 and variable2 have the value of 10. After line 7 is executed, variable1 has the value of 2, and variable2 still has the value of 10. The answer should therefore be (2) 12 Wayne Wylupski Intermetrics, Inc.