From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 16 Sep 91 04:37:56 GMT From: ogicse!milton!mfeldman@uunet.uu.net (Michael Feldman) Subject: Re: How to put an integer into a char? Message-ID: <1991Sep16.043756.706@milton.u.washington.edu> List-Id: In article <49974@seismo.CSS.GOV> 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. ASCII is a sub-package within PACKAGE Standard. I cannot imagine Alsys not implementing it, as it is required. Try this code: WITH Text_IO; PROCEDURE Beep IS C: Character; BEGIN C := ASCII.Bel; Text_IO.Put(C); END Beep; If you insist on working with the numerical values, try C := Character'Val(7); instead of the other assignment. The values in Character are in ASCII collating sequence, so the above will store in C the Character (ASCII) value in position 7 of the type, i.e. the Bel character "ASCII 7". Mike Feldman ------------------------------------------------------------------------------- Michael B. Feldman Visiting Professor 1991-92 Professor Dept. of Comp. Sci. and Engrg. Dept. of Elect. Engrg. and Comp. Sci. University of Washington FR-35 The George Washington University Seattle, WA 98105 Washington, DC 20052 (206) 685-1376 (voice) (202) 994-5253 (voice) (206) 543-2969 (fax) (202) 994-5296 (fax) -------------------------------------------------------------------------------