comp.lang.ada
 help / color / mirror / Atom feed
* scope and/or parameters (beginner)
@ 1999-04-02  0:00 fluffy_pink
  1999-04-03  0:00 ` Matthew Heaney
  1999-04-05  0:00 ` Corey Ashford
  0 siblings, 2 replies; 44+ messages in thread
From: fluffy_pink @ 1999-04-02  0:00 UTC (permalink / raw)


Hi,

My problem has to do with using the proper types of 
parameters and the distinctions between the formal and 
the actual ones, all of this in the context of wanting 
to pass a value two (2) levels down and then one (1) 
level back up. (Passing a value from a sub-program to 
one of its constituent sub-program is what I call 
passing that value one level down.) 

Here is what I have that doesn't work:
-----------------------------------------------------------
PROCEDURE One_Procedure
	   (	Second_Variable :	IN   The_Type;
		Third_Variable :	OUT  The_Type ) IS

--  types & sub-types: none ===========================
--  sub-programs ======================================

	PROCEDURE Internal_Procedure                  
		   (	One_Variable :		IN OUT  The_Type ) IS
	BEGIN
		One_Variable := One_Variable + A_Constant;
		-- What goes on here is not important.  The point
		-- Is that I am (want to) modify the value of
		-- "One_Variable" and bring its new value to
		-- "One_Procedure", as an IN OUT should be used.
	END Internal_Procedure;              

--  variables: none ===================================

BEGIN -- One_Procedure

	Internal_Procedure ( One_Variable => (QUESTION) );
	Third_Variable = Second_Variable + Another_Constant;
	-- More stuff goes here using "Third_Variable".
    
END One_Procedure;
-----------------------------------------------------------

In my main program I have declared the following variables:

	Var_2, Var_3 : The_Type;

In my main program I am calling "One_Proc�dure" with:

   One_Procedure
	(Second_Variable => Var_2, Third_Variable => Var_3);

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.  Obviously, if
I use "Var_2", then it says that it cannot see "Var_2"; that I think I
understand.

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.

Thanks and forgive me if it's not clear.  I really tried.


Marc
--
What I really am is "fluffy", no "_dong",
no "_puff", no "_woo", no  nothing, just plain fluffy.






^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~1999-04-22  0:00 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-02  0:00 scope and/or parameters (beginner) fluffy_pink
1999-04-03  0:00 ` Matthew Heaney
1999-04-05  0:00 ` Corey Ashford
1999-04-05  0:00   ` fluffy_doo
1999-04-06  0:00     ` Matthew Heaney
1999-04-08  0:00     ` czgrr
1999-04-10  0:00       ` fluffy_puff
1999-04-12  0:00       ` dennison
1999-04-13  0:00         ` Robert Dewar
1999-04-13  0:00         ` czgrr
1999-04-13  0:00           ` Robert Dewar
1999-04-14  0:00             ` czgrr
1999-04-14  0:00               ` dennison
1999-04-14  0:00               ` Robert Dewar
1999-04-15  0:00                 ` czgrr
1999-04-15  0:00                   ` Robert Dewar
1999-04-13  0:00     ` Robert A Duff
1999-04-14  0:00       ` Robert Dewar
1999-04-14  0:00         ` Hyman Rosen
1999-04-14  0:00           ` dennison
1999-04-14  0:00             ` Hyman Rosen
1999-04-14  0:00               ` dennison
1999-04-14  0:00                 ` Hyman Rosen
1999-04-15  0:00                   ` dennison
1999-04-15  0:00                     ` Robert Dewar
1999-04-15  0:00                       ` Hyman Rosen
1999-04-15  0:00                       ` dennison
1999-04-15  0:00           ` Robert Dewar
1999-04-15  0:00             ` Hyman Rosen
1999-04-15  0:00               ` Robert Dewar
1999-04-15  0:00                 ` Hyman Rosen
1999-04-16  0:00               ` Rakesh Malhotra
1999-04-15  0:00       ` fluffy_dong
1999-04-15  0:00         ` Robert Dewar
1999-04-15  0:00           ` dennison
1999-04-15  0:00             ` fluffy_dong
1999-04-16  0:00               ` Robert Dewar
1999-04-16  0:00                 ` Fraser Wilson
1999-04-16  0:00                   ` Gautier.DeMontmollin
1999-04-20  0:00                     ` Nick Roberts
1999-04-21  0:00                     ` fraser
1999-04-22  0:00               ` Robert A Duff
1999-04-22  0:00                 ` Larry Kilgallen
1999-04-16  0:00         ` Samuel Mize

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox