comp.lang.ada
 help / color / mirror / Atom feed
From: "Jerry van Dijk" <jvandyk@ibm.net>
Subject: Re: is there a getch() for ada95??
Date: 1996/12/31
Date: 1996-12-31T00:00:00+00:00	[thread overview]
Message-ID: <01bbf762$a6d5b660$f22d5c8b@jerryware> (raw)
In-Reply-To: 32C869F4.5F20@pcnet.com


Micheal,

> And I'm trying to create a small package to handle
> console i/o.

Unfortunately, that is difficult to answer without knowing which
compiler/operating
system you are using.

If, for example, you are using GNAT on DOS (which I suspect) the answer
is that
there are several posibilities for console I/O.

In general though, if you are using GNAT, you can call the C library
function
getch() from Ada, like in:

	with Ada.Text_IO; use Ada.Text_IO;

	procedure Test is

		function getch return Integer;
		pragma Import (C, getch);

	begin

		Put ("Press a key: ");
		Put_Line ("You pressed a key with scancode" & Integer'Image(getch));

	end Test;

with the best wishes for the new year!
Jerry.





  parent reply	other threads:[~1996-12-31  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-12-30  0:00 is there a getch() for ada95?? Michael Rizzo
1996-12-31  0:00 ` Tarjei T. Jensen
1996-12-31  0:00 ` Jerry van Dijk [this message]
1997-01-12  0:00 ` is there a getch() for ada95?? [LONG] tconiam
replies disabled

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