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=1.9 required=5.0 tests=BAYES_50,FROM_ADDR_WS, INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rutgers!mcnc!uvaarpa!vger.nsu.edu!g_harrison From: g_harrison@vger.nsu.edu ((George C. Harrison) Norfolk State University) Newsgroups: comp.lang.ada Subject: Re: Programming Question Message-ID: <491.27956532@vger.nsu.edu> Date: 17 Jan 91 12:49:54 GMT References: <27954d2b.64e9@petunia.CalPoly.EDU> Distribution: na List-Id: In article <27954d2b.64e9@petunia.CalPoly.EDU>, ssenkere@polyslo.CalPoly.EDU () 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.