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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.59.85 with SMTP id i82mr446122ioa.35.1505365760518; Wed, 13 Sep 2017 22:09:20 -0700 (PDT) X-Received: by 10.36.121.71 with SMTP id z68mr49101itc.4.1505365760489; Wed, 13 Sep 2017 22:09:20 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!o200no185855itg.0!news-out.google.com!p6ni285itp.0!nntp.google.com!o200no185851itg.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 13 Sep 2017 22:09:20 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:645:c001:2a91:f0aa:544a:62b8:1941; posting-account=fxr6CwoAAABjARAbZ01okNaxDpxQT8RH NNTP-Posting-Host: 2601:645:c001:2a91:f0aa:544a:62b8:1941 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4776d346-325b-4685-8ff4-ddb4ff6e08e3@googlegroups.com> Subject: use Ada.Text_IO in main() or Package? From: Mace Ayres Injection-Date: Thu, 14 Sep 2017 05:09:20 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Body-CRC: 2320109481 X-Received-Bytes: 2342 Xref: news.eternal-september.org comp.lang.ada:48116 Date: 2017-09-13T22:09:20-07:00 List-Id: I am moving code I had in main() into a package and getting errors. In main(), I had with Ada.Text_IO and use Ada.Text_IO and all worked OK. When moving code into a package, to be called from Main(), with and use clauses in Main() are not seen in Package code & adding with and use Ada-Text_IO in package throws error "with can only appear in context clause" I get lost here. - -------------------------- package body structures is with Ada.Text_IO; use Ada.Text_IO; PROCEDURE set_up is -------------------------------- with Ada.Text_IO; use Ada.Text_IO; -- throws error, without it errors in put_line and other Ada.Text_IO functions.. type grid is array (1..9) of Integer; layer_1: grid:=(1,2,3,4,5,6,7,8,9); begin New_Line(2); Put_Line("Hello Michael from Ada"); Put_Line(sayhi("Hi")); -- parameter not used in structures::say; it uses its own New_Line; for i of layer_1 loop Put ("Layer 1 grid one dimension has values:" ); Put(layer_1(i),Width=>2); -- Width :=3)); New_Line; end loop; New_line(2); end set_up; -----------------------------------------------