From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!hubcap!billwolf%hazel.cs.clemson.edu From: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,) Newsgroups: comp.lang.ada Subject: Re: Parameter Passing Message-ID: <5824@hubcap.clemson.edu> Date: 21 Jun 89 17:23:54 GMT References: <1116@bdmrrr.bdm.com> Sender: news@hubcap.clemson.edu Reply-To: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu List-Id: >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