From: Petter Fryklund <petter.fryklund@atero.se>
Subject: Re: use Ada.Text_IO in main() or Package?
Date: Wed, 13 Sep 2017 23:33:32 -0700 (PDT)
Date: 2017-09-13T23:33:32-07:00 [thread overview]
Message-ID: <28656db4-5b5a-48db-98f5-70bdf0b8ff7c@googlegroups.com> (raw)
In-Reply-To: <441b111c-0cf4-4582-a391-d6bb828e1023@googlegroups.com>
Den torsdag 14 september 2017 kl. 07:12:32 UTC+2 skrev Mace Ayres:
> Correction: using with and use AdA.TEXT_IO before in within package function both don't work. I don 't use it in both places.
I would do it like this:
with Ada.Text_IO;
with Where_Ever_Say_Hi_Lives;
package body Structures is
procedure Set_Up is --------------------------------
type grid is array (1..9) of Integer;
layer_1 : grid := (1,2,3,4,5,6,7,8,9);
begin
Ada.Text_IO.New_Line(2);
Ada.Text_IO.Put_Line("Hello Michael from Ada");
Ada.Text_IO.Put_Line(Where_Ever_Say_Hi_Lives.Say_Hi("Hi"));
Ada.Text_IO.New_Line;
for I of Layer_1 loop
Ada.Text_IO.Put("Layer 1 grid one dimension has values:" );
Ada.Text_IO.Put(layer_1(I), Width => 2); -- Width :=3));
Ada.Text_IO.New_Line;
end loop;
Ada.Text_IO.New_line(2);
end Set_Up; -----------------------------------------------
But I am of old school. I don't use use, I use package renamings in a small scope.
https://books.google.se/books?id=iPZGJRW9bKgC&pg=PA44&lpg=PA44&dq=write+once+read+many+programming+style&source=bl&ots=Dt_NIoNyK5&sig=QKkQWPIatt0HeyVcl6BXeRv3Lpo&hl=sv&sa=X&ved=0ahUKEwjr5NnphqTWAhXDFZoKHUqLBucQ6AEIdjAJ#v=onepage&q=write%20once%20read%20many%20programming%20style&f=false
next prev parent reply other threads:[~2017-09-14 6:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-14 5:09 use Ada.Text_IO in main() or Package? Mace Ayres
2017-09-14 5:12 ` Mace Ayres
2017-09-14 6:33 ` Petter Fryklund [this message]
2017-09-14 6:51 ` Mace Ayres
2017-09-15 5:22 ` Petter Fryklund
2017-09-14 6:21 ` gautier_niouzes
2017-09-14 6:47 ` Mace Ayres
2017-09-14 7:13 ` gautier_niouzes
2017-09-14 9:37 ` Mace Ayres
2017-09-14 9:49 ` gautier_niouzes
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox