comp.lang.ada
 help / color / mirror / Atom feed
From: Denis McMahon <denismfmcmahon@gmail.com>
Subject: Re: actual for variable name must be variable compiler error
Date: Mon, 29 Sep 2014 14:27:14 +0000 (UTC)
Date: 2014-09-29T14:27:14+00:00	[thread overview]
Message-ID: <m0bq81$b3k$2@dont-email.me> (raw)
In-Reply-To: ccf9dd3c-c956-4ff7-bc63-2e7c3df91e2d@googlegroups.com

On Sun, 28 Sep 2014 17:48:20 -0700, Stribor40 wrote:

> Can anyone please explain whats the difference. Should in out be allowed
> to read and write to parameters.

You can't pass a literal value to a function parameter of type in out.

At the end of the procedure, it will write the updated value back to the 
calling statement. When it tries to do that, if you passed it a literal 
value, what is it going to send the updated value back to?

It can't change a literal 5 into a 4 or a 6 if the parameter was modified 
in the procedure, but you've told it (by declaring the parameter in out) 
that you want the parameter written back to the calling statement.

It's like writing:

5 = fn(5)

-- 
Denis McMahon, denismfmcmahon@gmail.com


      parent reply	other threads:[~2014-09-29 14:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29  0:48 actual for variable name must be variable compiler error Stribor40
2014-09-29  2:50 ` Jeffrey Carter
2014-09-29 10:39 ` Brian Drummond
2014-09-29 19:37   ` Simon Clubley
2014-09-29 21:33     ` Georg Bauhaus
2014-09-30  0:27       ` Simon Clubley
2014-09-30 12:09         ` Peter Chapin
2014-09-30 13:17         ` Dennis Lee Bieber
2014-09-30 19:48           ` Simon Clubley
2014-09-30 14:47         ` Adam Beneschan
2014-09-29 14:27 ` Denis McMahon [this message]
replies disabled

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