comp.lang.ada
 help / color / mirror / Atom feed
From: steved@pacifier.com (Steve Doiel)
Subject: Re: Cursor positioning with console application under Windows NT
Date: 1997/11/27
Date: 1997-11-27T00:00:00+00:00	[thread overview]
Message-ID: <347d02ee.0@news.pacifier.com> (raw)
In-Reply-To: 347C7BD0.730C@online.no


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.





  reply	other threads:[~1997-11-27  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <01bcfa8c$e3d34310$123d7a86@dchristensen>
1997-11-26  0:00 ` Cursor positioning with console application under Windows NT Tarjei T. Jensen
1997-11-27  0:00   ` Steve Doiel [this message]
1997-12-04  0:00     ` Chad R. Meiners
1997-12-06  0:00       ` Cursor positioning with console application under Window Jerry van Dijk
1997-11-28  0:00 ` Cursor positioning with console application under Windows NT Jerry van Dijk
1997-12-01  0:00 ` Jon Jensen
replies disabled

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