From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!dali.cs.montana.edu!uakari.primate.wisc.edu!sdd.hp.com!hplabs!hpda!hpcuhb!hpcllla!hpclisp!hpclapd!defaria From: defaria@hpclapd.HP.COM (Andy DeFaria) Newsgroups: comp.lang.ada Subject: Re: How do I read in a character w/out pressing return ? Message-ID: <920037@hpclapd.HP.COM> Date: 21 Nov 90 19:25:12 GMT References: <3858@uniol.UUCP> Organization: Hewlett-Packard Calif. Language Lab List-Id: Seems we just went through this discussion a little while back. There is no good way to do it using pure Ada. The best way to accomplish this, IMHO, is to interface with the OS system call that reads a character. Encapsulate this procedures (GET_KEY) into a package (SYSTEM_CALLS) to minimize and localize portablity concerns. The Ada call will 1) insure the types coming in and going out are correct and pragma INTERFACE to the correct system call (depending, of course, on the OS in question). so (hypothetical example, assume reasonable type definitions): package SYSTEM_CALLS is type STATUS_TYPE is new INTEGER; type CHAR_PTR is access CHARACTER; OK : constant STATUS_TYPE := 0; function GET_KEY (THE_CHARACTER : in CHAR_PTR) return STATUS_TYPE; pragma INTERFACE (C, GET_KEY); pragma INTERFACE_NAME (GET_KEY, "getchar"); end SYSTEM_CALLS;