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.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bionet!ames!haven!vrdxhq!bdmrrr!jon From: jon@bdmrrr.bdm.com (Jon Humphreys) Newsgroups: comp.lang.ada Subject: Parameter Passing Message-ID: <1116@bdmrrr.bdm.com> Date: 21 Jun 89 13:16:23 GMT Organization: BDM Corp., McLean, Virginia List-Id: 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