comp.lang.ada
 help / color / mirror / Atom feed
From: ftpbox!mothost!motcid!bachww@uunet.uu.net  (Bud Bach)
Subject: Re: How to put an integer into a char?
Date: 20 Sep 91 14:03:15 GMT	[thread overview]
Message-ID: <5480@melon21.UUCP> (raw)

black@beno.CSS.GOV (Mike Black) writes:

>I recently took an Ada class and was trying to use a DOS call to
>make the terminal beep on an input error.  However, I couldn't
>find a (easy) way to put a CTRL-G (ASCII 7) into a CHARACTER object.
>The ASCII package is apparently not defined for Alsys 4.3 on MS-DOS.
>So, is there a way to do this folks?
>Mike...

Mike, I suspect that your problem may be that you are trying to "with"
package "ascii".  "Ascii" is defined within the scope of standard and may
not be explicitly withed.  Here is an example for you:

    with text_io;
    procedure beep is
      bell : constant character := ascii.bel;
    begin
      text_io.put (bell);
    end beep;

The less elegent way to do this would be:

    with text_io;
    procedure beep is
      bell : constant character := character'val(7);
                                   ----------------
    begin
      text_io.put (bell);
    end beep;

-- Bud
-- 
Bud Bach - Consultant				c/o Motorola
708 632-6611					Cellular Infrastructure Group
...!uunet!motcid!bachww or			1501 W. Shure Drive, MS-1235
bachww%motcid@uunet.uu.net			Arlington Heights, IL  60004

             reply	other threads:[~1991-09-20 14:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-09-20 14:03 Bud Bach [this message]
  -- strict thread matches above, loose matches on Subject: below --
1991-09-16  4:37 How to put an integer into a char? Michael Feldman
1991-09-15 16:05 Mike Black
replies disabled

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