comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: package body
Date: Tue, 07 Oct 2014 21:05:58 +0100
Date: 2014-10-07T21:05:58+01:00	[thread overview]
Message-ID: <lyk34babmh.fsf@pushface.org> (raw)
In-Reply-To: 7c811e73-61e2-4c89-abb3-749d31461758@googlegroups.com

Stribor40 <ikamzic@gmail.com> writes:

> I have following....
>
> package spec file
> package body which contains one function and one procedure and one
> global variable

I would call this variable package-local, since nothing outside the
package body can see it.

> I would like to access this global variable(with its data) from client
> file.

What is a "client file"? Is it another Ada package/subprogram?

> Is there anything wrong with doing g it this way and if there is
> better way to do this?

Unless I've misunderstood you, you *can't* do it this way. I suppose you
could put the variable in the (public part of) the package spec. You
might alternatively provide accessor operations; that way you could
control/validate accesses and only let the "clients" see the data you
want them to.


  parent reply	other threads:[~2014-10-07 20:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-07 19:58 package body Stribor40
2014-10-07 20:05 ` sbelmont700
2014-10-07 20:05 ` Simon Wright [this message]
2014-10-07 20:17 ` Jeffrey Carter
replies disabled

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