comp.lang.ada
 help / color / mirror / Atom feed
From: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,)
Subject: Re: Parameter Passing
Date: 21 Jun 89 17:23:54 GMT	[thread overview]
Message-ID: <5824@hubcap.clemson.edu> (raw)
In-Reply-To: 1116@bdmrrr.bdm.com

From article <1116@bdmrrr.bdm.com>, by jon@bdmrrr.bdm.com (Jon Humphreys):
> 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? 

    Sure, it's easy.  Just set up:

      package Global_Variables is

         First_Variable  : First_Variable_Type := Initial_Value;

         Second_Variable : Second_Variable_Type;

         -- etc...

      end Global_Variables;

   Then simply with the package whenever you need it; just remember 
   to qualify all references with the package name, e.g., 

      Global_Variables.First_Variable := whatever...;

   Now as to whether or not this is a good idea, I think *you* already
   know that the application should be redesigned rather than translated
   literally; so just post your boss's e-mail address and we'll...   :-)


   Bill Wolfe, wtwolfe@hubcap.clemson.edu

  reply	other threads:[~1989-06-21 17:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1989-06-21 13:16 Parameter Passing Jon Humphreys
1989-06-21 17:23 ` William Thomas Wolfe,2847, [this message]
  -- 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