comp.lang.ada
 help / color / mirror / Atom feed
From: "Marc A. Criley" <mcNOSPAM@mckae.com>
Subject: Re: "out" and  "in out"
Date: Mon, 26 Jul 2004 09:16:46 -0500
Date: 2004-07-26T09:16:46-05:00	[thread overview]
Message-ID: <2mki2jFn80o0U1@uni-berlin.de> (raw)
In-Reply-To: mailman.44.1090839265.416.comp.lang.ada@ada-france.org

"Christoph Karl Walter Grein" <AdaMagica@web.de> wrote:
>
> In your case, the passing mechanism is by reference, so you get what you
get. But don't rely on this, rely only on the mode, i.e. the parameter st is
undefined upon entering the procedure modify, so when you only write
component 2, upon return, only component 2 has been written. Under slight
variations, the result of your code might be <garbage character>U<garbage
character>.
>
> Another thing: Don't rely upon s1'First = 1. Component 2 might not exist.

While you can't rely on the initial _value_ of the parameter, you _can_ rely
on getting accurate information about it from its attributes.

As Christoph notes, while s1'First may not be 1, s1'First will correctly
reflect the argument's index's first value, similarly for s1'Last and
s1'Length--in this case, 3. And so on for other relevant attributes.

Marc A. Criley
McKae Technologies
www.mckae.com





  reply	other threads:[~2004-07-26 14:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-26 10:54 "out" and "in out" Christoph Karl Walter Grein
2004-07-26 14:16 ` Marc A. Criley [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-07-26  9:58 zork
2004-07-26 11:00 ` David C. Hoos
2004-07-26 11:30 ` Martin Krischik
2004-07-26 14:46 ` Nick Roberts
2004-07-28 14:07   ` zork
replies disabled

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