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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c83ec73b53ef3ce2 X-Google-Attributes: gid103376,public From: steved@pacifier.com (Steve Doiel) Subject: Re: Cursor positioning with console application under Windows NT Date: 1997/11/27 Message-ID: <347d02ee.0@news.pacifier.com>#1/1 X-Deja-AN: 293072546 References: <01bcfa8c$e3d34310$123d7a86@dchristensen> <347C7BD0.730C@online.no> Newsgroups: comp.lang.ada Date: 1997-11-27T00:00:00+00:00 List-Id: In article <347C7BD0.730C@online.no>, tarjei@online.no says... > >David Christensen wrote: >> >> Does anyone have any suggestions or pointers for positioning the cursor in >> a console application under Windows NT? Using ANSI escape sequences is not >> supported under NT and I haven't found any other mehtods available with >> standard ADA. (If it matters, I can use either AONIX ObjectAda or the GNAT >> complier.) > > >To get support for ANSI escape sequences you load ansi.sys or equivalent >in the config.nt file. I believe that it is located in the system32 >directory. At least that is what I did under NT 3.51. > >I think the ansi.sys statements is present, but commented out in the >config.nt files that comes right out of the box. > After several attempts, I gave up on trying to get the ANSI.SYS file to work with GNAT or ObjectAda applications. I believe that ANSI.SYS does not work with Win32 App's. Here's my cursor position procedure that works under both ObjectAda and GNAT: -------------------------------------------------------------------- PACKAGE WinBase RENAMES Win32.Winbase; PACKAGE WinCon RENAMES Win32.WinCon; PROCEDURE CursorPosn( row, col : Natural ) IS result : Win32.BOOL; toRow : Natural := Natural'MAX( row, 1 ); toCol : Natural := Natural'MAX( col, 1 ); BEGIN result := WinCon.SetConsoleCursorPosition( WinBase.GetStdHandle( WinBase.STD_OUTPUT_HANDLE ), WinCon.COORD'( X => Win32.Short( toCol - 1 ), y => Win32.Short( toRow - 1 ) ) ); END CursorPosnTIF; ------------------------------------------------------------------- You of course need to use the Win32ada bindings fo this. I hope this helps, BTW: there are a number of other console functions for doing similar things.