* How do I use the package characters?
@ 1996-10-07 0:00 Stephen M O'Shaughnessy
1996-10-08 0:00 ` Stephen M O'Shaughnessy
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Stephen M O'Shaughnessy @ 1996-10-07 0:00 UTC (permalink / raw)
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?
Thanks
Steve O
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How do I use the package characters?
@ 1996-10-09 0:00 John Herro
0 siblings, 0 replies; 8+ messages in thread
From: John Herro @ 1996-10-09 0:00 UTC (permalink / 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How do I use the package characters?
@ 1996-10-09 0:00 John Herro
1996-10-09 0:00 ` Robert Dewar
0 siblings, 1 reply; 8+ messages in thread
From: John Herro @ 1996-10-09 0:00 UTC (permalink / raw)
smosha@most.fw.hac.com (Stephen M O'Shaughnessy) wrote:
> A little digging and I realized that the work-
> stations where running Ada-83. This is an
> Ada-95 package.
I'm posting this before my earlier post appears in CLA, because I saw
Stephen's reply to Ben. Yes, the package you mentioned is an Ada 95
package, and Ada 83 packages don't have children, hence no periods.
But you can reference package ASCII in Ada 83, and the steps are a
little different, because ASCII is inside Standard, and you never have to
WITH Standard; it's automatically WITHed in every compilation. You can
optionally write a USE clause for ASCII, but it goes in the declarative
region of your program. For example, here are two ways to beep the
terminal in Ada 83:
-----
with Text_IO;
procedure Beep is
begin
Text_IO.Put(ASCII.BEL);
end Beep;
-----
with Text_IO; use Text_IO;
procedure Beep is
use ASCII;
begin
Put(BEL);
end Beep;
- John Herro
Software Innovations Technology
You can download an Ada Tutor program at:
http://members.aol.com/AdaTutor
ftp://members.aol.com/AdaTutor
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How do I use the package characters?
1996-10-09 0:00 John Herro
@ 1996-10-09 0:00 ` Robert Dewar
0 siblings, 0 replies; 8+ messages in thread
From: Robert Dewar @ 1996-10-09 0:00 UTC (permalink / raw)
John Herro said
" I'm posting this before my earlier post appears in CLA, because I saw
Stephen's reply to Ben. Yes, the package you mentioned is an Ada 95
package, and Ada 83 packages don't have children, hence no periods.
But you can reference package ASCII in Ada 83, and the steps are a
little different, because ASCII is inside Standard, and you never have to
WITH Standard; it's automatically WITHed in every compilation. You can
optionally write a USE clause for ASCII, but it goes in the declarative
region of your program. For example, here are two ways to beep the
terminal in Ada 83:"
That's confused. The original question was about Ada.Characters.Handling
which is not related to Standard.Ascii.
Standard.Ascii provides a subset of the functionality of
Ada.Characters.Latin_1, but none of the functoinality
of Ada.Characters.Handling.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~1996-10-09 0:00 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-10-07 0:00 How do I use the package characters? Stephen M O'Shaughnessy
1996-10-08 0:00 ` Stephen M O'Shaughnessy
1996-10-08 0:00 ` Robert Dewar
1996-10-08 0:00 ` Stephen Leake
1996-10-09 0:00 ` Michael Feldman
-- strict thread matches above, loose matches on Subject: below --
1996-10-09 0:00 John Herro
1996-10-09 0:00 John Herro
1996-10-09 0:00 ` Robert Dewar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox