comp.lang.ada
 help / color / mirror / Atom feed
* Problem with child package
@ 1995-03-02 12:39 DELROEUX JEAN-YVES
  1995-03-03 18:31 ` Stephen A. Leake
  1995-03-03 22:52 ` Robert Dewar
  0 siblings, 2 replies; 3+ messages in thread
From: DELROEUX JEAN-YVES @ 1995-03-02 12:39 UTC (permalink / raw)


Hello, I explain my problem :
I define a type carav is new voiture in a child package of the package
voiture. But when i define a global variable of this type (carav), the 
compiler ( gnat 2.00 under OS/2 Warp ), It says no errors. But when I want
to use it into procedure of another package, The compiler said a lot of errors
The errors says that it's doesn't know the veriable I define ??

But it work correctly if I pass this variable as parameter into each 
procedure . Does it mean that I can't define a global variable when the type
is defined into a child package. Can someone help me please.

	Thanks for your respond.

	DELROEUX Jean - Yves



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

* Re: Problem with child package
  1995-03-02 12:39 Problem with child package DELROEUX JEAN-YVES
@ 1995-03-03 18:31 ` Stephen A. Leake
  1995-03-03 22:52 ` Robert Dewar
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen A. Leake @ 1995-03-03 18:31 UTC (permalink / raw)



<discription of carav and voiture packages and child packages>

Remember that there are many scopes in Ada, not just 'local' and
'global. In which package did you declare your 'global' variable? That
package must be visible (via 'with' and possibly 'use') at the point
you want to use the variable.

For example:

package voiture is
	type carav_1 is ...;
end voiture;

package voiture.child is
	type carav is new carav_1 ...;

	global_var : carav;
end voiture.child;

with voiture.child;
procedure access_global_var is
begin
	voiture.child.global_var := ...
end access_global_var;

If your code looks different, post some of it, maybe that will help.

- Stephe
--
Stephen Leake, NASA Goddard Space Flight Center
email: Stephen.Leake@gsfc.nasa.gov



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

* Re: Problem with child package
  1995-03-02 12:39 Problem with child package DELROEUX JEAN-YVES
  1995-03-03 18:31 ` Stephen A. Leake
@ 1995-03-03 22:52 ` Robert Dewar
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Dewar @ 1995-03-03 22:52 UTC (permalink / raw)


Jean-Yves, if you have a problem with GNAT, please follow the documentation
and submit a query, with full sources, to gnat-report.

Sorry to keep posting these reponses, but this seems like an IFAQ
(incredibly frequent asked question).

In general, always send sources, from your vague description I can't even
guess what you might be doing wrong.




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

end of thread, other threads:[~1995-03-03 22:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-03-02 12:39 Problem with child package DELROEUX JEAN-YVES
1995-03-03 18:31 ` Stephen A. Leake
1995-03-03 22:52 ` Robert Dewar

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