* Re: Cursor positioning with console application under Windows NT [not found] <01bcfa8c$e3d34310$123d7a86@dchristensen> @ 1997-11-26 0:00 ` Tarjei T. Jensen 1997-11-27 0:00 ` Steve Doiel 1997-11-28 0:00 ` Cursor positioning with console application under Windows NT Jerry van Dijk 1997-12-01 0:00 ` Jon Jensen 2 siblings, 1 reply; 6+ messages in thread From: Tarjei T. Jensen @ 1997-11-26 0:00 UTC (permalink / raw) 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. Greetings, -- // Tarjei T. Jensen // tarjei@online.no || voice +47 51 62 85 58 // Support you local rescue centre: GET LOST! ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cursor positioning with console application under Windows NT 1997-11-26 0:00 ` Cursor positioning with console application under Windows NT Tarjei T. Jensen @ 1997-11-27 0:00 ` Steve Doiel 1997-12-04 0:00 ` Chad R. Meiners 0 siblings, 1 reply; 6+ messages in thread From: Steve Doiel @ 1997-11-27 0:00 UTC (permalink / raw) 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. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cursor positioning with console application under Windows NT 1997-11-27 0:00 ` Steve Doiel @ 1997-12-04 0:00 ` Chad R. Meiners 1997-12-06 0:00 ` Cursor positioning with console application under Window Jerry van Dijk 0 siblings, 1 reply; 6+ messages in thread From: Chad R. Meiners @ 1997-12-04 0:00 UTC (permalink / raw) I dug through the Win32 SDK and discovered that ansi escape are not checked for in the API used to print to the console. This explains why programs compiled with a dos compiler will still work with a ansi.sys file or an equivelant TSR. The Gnat 3.10p NT compiler to my understanding uses the NT API's so ansi will not work with it anyway. Jerry van Dijk's cursor package is a better way to position the cursor anyway. This poses the question, "Has anyone written a nice package to use all the features of the console API's?" Chad R. Meiners ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cursor positioning with console application under Window 1997-12-04 0:00 ` Chad R. Meiners @ 1997-12-06 0:00 ` Jerry van Dijk 0 siblings, 0 replies; 6+ messages in thread From: Jerry van Dijk @ 1997-12-06 0:00 UTC (permalink / raw) In article <3486f01b.0@silver.truman.edu> v025@academic.truman.edu writes: >This poses the question, "Has anyone written a nice package to use all the >features of the console API's?" If you really want to use _ALL_ features of the console API's, use the Win32 binding. If, on the other hand, you just need something akin to the DOS console I/O stuff, yep, it's there. Just not published yet. This API is of the usual MS quality... -- -- Jerry van Dijk | Leiden, Holland -- Consultant | Team Ada -- Ordina Finance | jdijk@acm.org ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cursor positioning with console application under Windows NT [not found] <01bcfa8c$e3d34310$123d7a86@dchristensen> 1997-11-26 0:00 ` Cursor positioning with console application under Windows NT Tarjei T. Jensen @ 1997-11-28 0:00 ` Jerry van Dijk 1997-12-01 0:00 ` Jon Jensen 2 siblings, 0 replies; 6+ messages in thread From: Jerry van Dijk @ 1997-11-28 0:00 UTC (permalink / raw) >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.) As this seems to become a popular question, I've put a small package for cursor positioning on NT under the 'misc' section of my homepage at http://stad.dsl.nl/~jvandyk This package does not require an Win32 binding and will work with either GNAT or OA. -- -- Jerry van Dijk | Leiden, Holland -- Consultant | Team Ada -- Ordina Finance | jdijk@acm.org ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cursor positioning with console application under Windows NT [not found] <01bcfa8c$e3d34310$123d7a86@dchristensen> 1997-11-26 0:00 ` Cursor positioning with console application under Windows NT Tarjei T. Jensen 1997-11-28 0:00 ` Cursor positioning with console application under Windows NT Jerry van Dijk @ 1997-12-01 0:00 ` Jon Jensen 2 siblings, 0 replies; 6+ messages in thread From: Jon Jensen @ 1997-12-01 0:00 UTC (permalink / raw) Modify your config.nt file to include the following: device=c:\winnt40\system32\ansi.sys Assuming of course you installed Windows NT in the C:\winnt40. Caution - make sure you are using the ansi.sys provided with Windows NT and not the one from MSDOS or Windows/Windows 95. Windows NT does NOT have a DOS subsystem the way Windows 95 does and attempting to use DOS device drivers (like ANSI.SYS from those operating systems) will certainly cause you problems. Also any systems which will run your program will also have to have this modification made. David Christensen <david_christensen@phoenix.com> wrote in article <01bcfa8c$e3d34310$123d7a86@dchristensen>... > 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.) > > Thanks. > > David Christensen > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1997-12-06 0:00 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [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 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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox