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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a1c2523f8c9a6b7d X-Google-Attributes: gid103376,public From: john@assen.demon.co.uk (John McCabe) Subject: Re: Ada equivalent of C "static" structures Date: 1997/03/08 Message-ID: <332146fc.891048@news.demon.co.uk>#1/1 X-Deja-AN: 223953101 X-NNTP-Posting-Host: assen.demon.co.uk References: <33206981.84E@mccabe.com> Newsgroups: comp.lang.ada Date: 1997-03-08T00:00:00+00:00 List-Id: Michael Ibarra wrote: >I'm wondering if anyone can point me in the right direction: > >I need to declare a record which has "file" scope. This would be >something that every unit within this file could access, but could >not be accessed from any unit outside of this file. > >Any ideas??? > >thanks in advance >-Mike This really depends on exactly what you require. If you have 1 package to each file then Mr. Schneider's answer should be adequate, however if you are intending to have more than 1 package in a file then you will need to look closer at the overall structure. I'm sure I'll be corrected if I'm wrong here, but Ada doesn't support e.g. with System; type X is record : : end record; package body p_1 is : : end p_1; package body p_2 is : : end p_2; All type and object definitions must be within a program unit, and a file isn't one of those. You cold put a package definition round the above stuff, but then (In Ada 83) you would run into complications. My advice would be to define a separate package with the type or object definition you require, and only "with" it in a single file e.g: *file1* package data_package is type x is record : : end record; x_value : x; end data_package; *file2* with data_package; package body p_1 is : : end p_1; package body p_2 is : : end p_2; etc. Best Regards John McCabe