From: jon@bdmrrr.bdm.com (Jon Humphreys)
Subject: Parameter Passing
Date: 21 Jun 89 13:16:23 GMT [thread overview]
Message-ID: <1116@bdmrrr.bdm.com> (raw)
I'm currently trying to learn Ada by translating a program written
in BASIC (my employer's choice, not mine), and I've got a fairly
fundamental question: when passing parameters from one package
to another, is it possible to simulate something like a FORTRAN
common block by placing variables in a package and then
using the package whenever I need to access/modify the variables? For
example, consider the following hierarchy:
main
|
--------------------
| |
A B
---|---
| |
(B, C, and D are a package) C D
If a set of variables were used in procedures A and D, would it
be possible to create a package containing these variables and
then include them in procedure A and D? Or should all the variables
be declared in main and then passed as parameters to A and B, and then
from B to D (this seems inefficient)? I guess what I'm asking is, which
way would be considered correct in Ada? (Currently, we don't even have a
compiler, so there isn't any way for me to test this kind of thing.)
Thanks for any help,
jon
next reply other threads:[~1989-06-21 13:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
1989-06-21 13:16 Jon Humphreys [this message]
1989-06-21 17:23 ` Parameter Passing William Thomas Wolfe,2847,
-- strict thread matches above, loose matches on Subject: below --
2000-02-17 0:00 parameter passing Riyaz Mansoor
2000-02-18 0:00 ` Richard D Riehle
2000-02-19 0:00 ` Ehud Lamm
1990-06-29 15:32 David Guaspari
[not found] <1569@oravax.UUCP>
1990-06-27 15:32 ` stt
1990-06-27 17:15 ` Michael Feldman
1986-10-08 18:56 Eric Marshall
1986-10-10 16:46 ` Geoff Mendal
1986-10-30 23:08 ` Mats_Ohlin_FOA2
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox