From: g_harrison@vger.nsu.edu ((George C. Harrison) Norfolk State University)
Subject: Re: Programming Question
Date: 17 Jan 91 12:49:54 GMT [thread overview]
Message-ID: <491.27956532@vger.nsu.edu> (raw)
In-Reply-To: 27954d2b.64e9@petunia.CalPoly.EDU
In article <27954d2b.64e9@petunia.CalPoly.EDU>, ssenkere@polyslo.CalPoly.EDU (<Scimitar>) writes:
> What I would like to know is...
>
> Is there a way to access the cursor keys in ADA. Let me re-phrase that.
> Of course there IS a way... but with the standard packages provided... can
> it be easily done. Is there something similiar to the PUT(ascii.bs); for
> the backspace key....??
>
> Also... Is there any commands in the standard packages to place the cursor
...
Yes and No. ;-) These commands are machine/terminal dependent, but the
following routines (and more) work on VT's:
use ASCII;
-- CLEAR SCREEN on VT100 terminals
procedure CLS is
begin
PUT(ESC & "[H" & ESC & "[J");
end CLS;
--GOTOXY moves the cursor to (X,Y), where X is the row value (0..24) and
-- Y is the column value (0..80);
procedure GOTOXY(ROW, COL : in INTEGER) is
SLENGTH : constant POSITIVE := INTEGER'IMAGE(ROW)'LENGTH + INTEGER'IMAGE(COL
)'LENGTH + 4;
STR : STRING(1 .. SLENGTH) := ESC & "[" & INTEGER'IMAGE(ROW) & ";" &
INTEGER'IMAGE(COL) & "H";
begin
for I in 1 .. SLENGTH loop
if STR(I) /= ' ' then
PUT(STR(I));
end if;
end loop;
end GOTOXY;
etc...
--------------------------------------------------------------------------
-- George C. Harrison -------------- || -- Overworked, Underpaid, --------
---|| Professor of Computer Science || -- Unappreciated, but enjoying ---
---|| Norfolk State University, ---- || -- it all. -----------------------
---|| 2401 Corprew Avenue, Norfolk, Virginia 23504 -----------------------
---|| INTERNET: g_harrison@vger.nsu.edu ---------------------------------
-- || These are not necessarily the views of my employer, my family, or
-- || even myself.
next prev parent reply other threads:[~1991-01-17 12:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1991-01-17 7:07 Programming Question <agate!bionet!uwm.edu!zaphod.mps.ohio-state.edu!usc!petunia!news@ucbvax.Berkeley.EDU>
1991-01-17 12:49 ` (George C. Harrison) Norfolk State University [this message]
1991-01-18 3:24 ` Michael Feldman
1991-01-18 19:03 ` Arthur Evans
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox