comp.lang.ada
 help / color / mirror / Atom feed
From: johnherro@aol.com (John Herro)
Subject: Re: How do I use the package characters?
Date: 1996/10/09
Date: 1996-10-09T00:00:00+00:00	[thread overview]
Message-ID: <53fhcc$ivo@newsbf02.news.aol.com> (raw)


smosha@most.fw.hac.com (Stephen M O'Shaughnessy) writes:
> I would like to use the functions in the package characters.
> handling described in paragraph A.3.2 of the ARM.  How do I
> instantiate/reference these functions?
     Technically the package doesn't contain "functions," but I think I
know what you mean.  You want to reference the character definitions. 
Also, since the package isn't generic, you don't need to instantiate it,
but you do want to know how to reference it.  Two examples are below, but
here are the steps to follow:
     1. Begin your program with a WITH clause mentioning the package you
want to reference, probably Ada.Characters.Latin_1.
     2. Optionally supply a USE clause mentioning the same package.  If
you don't do this, you'll have to supply the package name and a dot
everywhere in your program that you reference characters from the package.
     For example, either of these two programs below will beep the
terminal:
-----
with Ada.Characters.Latin_1, Ada.Text_IO;
procedure Beep is
begin
   Ada.Text_IO.Put(Ada.Characters.Latin_1.BEL);
end Beep;
-----
with Ada.Characters.Latin_1, Ada.Text_IO;
use  Ada.Characters.Latin_1, Ada.Text_IO;
procedure Beep is
begin
   Put(BEL);
end Beep;
-----
     Note that you follow the same steps to reference ANY package.  In the
examples above, I referenced Ada.Text_IO the same way as
Ada.Characters.Latin_1.  I hope this helps.

- John Herro
Software Innovations Technology
An Ada Tutor program is available for download at:
http://members.aol.com/AdaTutor
ftp://members.aol.com/AdaTutor




             reply	other threads:[~1996-10-09  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-09  0:00 John Herro [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-10-09  0:00 How do I use the package characters? John Herro
1996-10-09  0:00 ` Robert Dewar
1996-10-07  0:00 Stephen M O'Shaughnessy
1996-10-08  0:00 ` Stephen Leake
1996-10-08  0:00 ` Robert Dewar
1996-10-08  0:00 ` Stephen M O'Shaughnessy
1996-10-09  0:00 ` Michael Feldman
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox