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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,a1a88c4d509f6381 X-Google-Attributes: gid103376,public From: Corey Ashford Subject: Re: scope and/or parameters (beginner) Date: 1999/04/05 Message-ID: <37084459.8616007@rocketmail.com>#1/1 X-Deja-AN: 462773298 Content-Transfer-Encoding: 8bit References: <37064309.889106243@news.dsuper.net> X-Accept-Language: en Content-Type: text/plain; charset=iso-8859-1 Organization: Rational Software Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-04-05T00:00:00+00:00 List-Id: fluffy_pink@dsuper.net wrote: [snip] > > If for "(QUESTION)" I use "Second_Variable" the compiler tells me that > for an OUT or an IN OUT I must have an actual parameter that **is a > variable***. I don't understand why it tells me this. "IN" parameters are considered read-only. You've tried to pass it to a procedure which may attempt to change its value - something that isn't allowed to a read-only variable. Treat "IN" parameters as constants that are defined when the subprogram is invoked. [snip] > > How can I pass the value of Var_2 from my main program, into > One_Procedure, and then from One_Procedure into Internal_Procedure, > and then to make it come back out modified (IN OUT) so that it will > end up in One_Proc�dure ? I don't want to use the modified value of > Var_2 (modified by Internal_Procedure) at the main program level; I > want to use it only in One_Proc�dure. [snip] Well, you could change the definition of One_prog so that its Second_Variable is of type "IN OUT The_Type", instead of just IN. Then you could call Inner_Procedure legally with Second_Variable. - Corey