comp.lang.ada
 help / color / mirror / Atom feed
* Why do the escape sequences not work?
@ 2004-10-02 12:55 GlesgaMick
  2004-10-02 12:58 ` stephane richard
  2004-10-05 17:45 ` GlesgaMick
  0 siblings, 2 replies; 18+ messages in thread
From: GlesgaMick @ 2004-10-02 12:55 UTC (permalink / raw)


According to what iv'e read, the commands to clear the screen are:

Ada.Text_IO.Put(Item => ASCII.ESC);
Ada.Text_IO.Put(Item => "[2J");

on my compuer they simply make the text value of ESC apear followed by the
[2J.  I'm using Windows ME at the command prompt. and suspect it has
sometyhing to do with the way the OS recognised escape codes... but ca
anyone direct me somewhere where i can find the right escape codes?






^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-02 12:55 Why do the escape sequences not work? GlesgaMick
@ 2004-10-02 12:58 ` stephane richard
  2004-10-02 13:02   ` stephane richard
                     ` (2 more replies)
  2004-10-05 17:45 ` GlesgaMick
  1 sibling, 3 replies; 18+ messages in thread
From: stephane richard @ 2004-10-02 12:58 UTC (permalink / raw)



"GlesgaMick" <sikmick@yahoo.com> wrote in message 
news:d23e6915629caea950f8445632cbd448@localhost.talkaboutprogramming.com...
> According to what iv'e read, the commands to clear the screen are:
>
> Ada.Text_IO.Put(Item => ASCII.ESC);
> Ada.Text_IO.Put(Item => "[2J");
>
> on my compuer they simply make the text value of ESC apear followed by the
> [2J.  I'm using Windows ME at the command prompt. and suspect it has
> sometyhing to do with the way the OS recognised escape codes... but ca
> anyone direct me somewhere where i can find the right escape codes?
>
>
I believe you need your ansi.sys driver installed (if that exists in XP 
:-).....it's a console problem. Only with ansi.sys installed (or emulated if 
it can) can these escape commands work. 





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-02 12:58 ` stephane richard
@ 2004-10-02 13:02   ` stephane richard
  2004-10-02 13:11     ` stephane richard
  2004-10-02 23:21   ` Ross Higson
  2004-10-03  0:37   ` Brian May
  2 siblings, 1 reply; 18+ messages in thread
From: stephane richard @ 2004-10-02 13:02 UTC (permalink / raw)


Oops! guess I hit that send button to quick.

device=c:\windows\command\ansi.sys in your config.sys file should do the 
trick. 





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-02 13:02   ` stephane richard
@ 2004-10-02 13:11     ` stephane richard
  2004-10-02 13:37       ` GlesgaMick
  0 siblings, 1 reply; 18+ messages in thread
From: stephane richard @ 2004-10-02 13:11 UTC (permalink / raw)


That will teach me to read answer, read and answer etc etc ;-).

Here's a link to where you can get a good complete list of ANSI escape 
sequences.

http://www.bluesock.org/~willg/dev/ansi.html

Stephane Richard
"Ada World" webmaster
http://www.adaworld.com





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-02 13:11     ` stephane richard
@ 2004-10-02 13:37       ` GlesgaMick
  2004-10-02 14:34         ` Marius Amado Alves
  2004-10-02 14:37         ` stephane richard
  0 siblings, 2 replies; 18+ messages in thread
From: GlesgaMick @ 2004-10-02 13:37 UTC (permalink / raw)


thank you very much for all the useful, and swift help you've given me
stephane, i did that thing to config.sys, but it didn't work, so i googled
the problem and found this:

http://satobs.org/seesat/Mar-2001/0144.html

it basically says you can't load ansi.sys into windows ME... thats a new
one on me... anyhoo thank again for trying to help.




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-02 13:37       ` GlesgaMick
@ 2004-10-02 14:34         ` Marius Amado Alves
  2004-10-02 14:37         ` stephane richard
  1 sibling, 0 replies; 18+ messages in thread
From: Marius Amado Alves @ 2004-10-02 14:34 UTC (permalink / raw)
  To: comp.lang.ada

Windows ceased supporting ANSI escape sequences around 2000.

However the old COMMAND.COM of MS-DOS 5 is usually shipped along with 
the new systems. It is not the default console (that is CMD), but it's 
there, even in the PATH. You can invoke COMMAND from CMD.

See also:

http://support.microsoft.com/default.aspx?scid=kb;en-us;101875#appliesto
http://www.winnetmag.com/Article/ArticleID/14818/14818.html




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-02 13:37       ` GlesgaMick
  2004-10-02 14:34         ` Marius Amado Alves
@ 2004-10-02 14:37         ` stephane richard
  1 sibling, 0 replies; 18+ messages in thread
From: stephane richard @ 2004-10-02 14:37 UTC (permalink / raw)


You're very welcome.

One thing you might want to look at, if you do plan on doing alot of text 
based applications in ada (windows console) is the ncurses library.

Have a look here: http://site.n.ml.org/info/ncurses/

You might find it useful :-)

Stephane Richard
"Ada World" webmaster
http://www.adaworld.com

"GlesgaMick" <sikmick@yahoo.com> wrote in message 
news:89e5761bd75b9396541b3abb44180bbb@localhost.talkaboutprogramming.com...
> thank you very much for all the useful, and swift help you've given me
> stephane, i did that thing to config.sys, but it didn't work, so i googled
> the problem and found this:
>
> http://satobs.org/seesat/Mar-2001/0144.html
>
> it basically says you can't load ansi.sys into windows ME... thats a new
> one on me... anyhoo thank again for trying to help.
> 





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-02 12:58 ` stephane richard
  2004-10-02 13:02   ` stephane richard
@ 2004-10-02 23:21   ` Ross Higson
  2004-10-02 23:52     ` Ross Higson
  2004-10-03  0:37   ` Brian May
  2 siblings, 1 reply; 18+ messages in thread
From: Ross Higson @ 2004-10-02 23:21 UTC (permalink / raw)


stephane richard wrote:

> "GlesgaMick" <sikmick@yahoo.com> wrote in message 
> news:d23e6915629caea950f8445632cbd448@localhost.talkaboutprogramming.com...
> 
>>According to what iv'e read, the commands to clear the screen are:
>>
>>Ada.Text_IO.Put(Item => ASCII.ESC);
>>Ada.Text_IO.Put(Item => "[2J");
>>
>>on my compuer they simply make the text value of ESC apear followed by the
>>[2J.  I'm using Windows ME at the command prompt. and suspect it has
>>sometyhing to do with the way the OS recognised escape codes... but ca
>>anyone direct me somewhere where i can find the right escape codes?
>>
>>
> 
> I believe you need your ansi.sys driver installed (if that exists in XP 
> :-).....it's a console problem. Only with ansi.sys installed (or emulated if 
> it can) can these escape commands work. 
> 
> 
The ansi.sys solution is sufficient if you only need to use the few 
escape codes that were originally supported by DOS - luckily "ESC[2J" is 
one of these. I'd certainly suggest you try that first.

However, if you can't get ansi.sys to work under Windows ME, or you want 
or need to use some of the more sophisticated escape codes then I have a 
package that is compatible with the standard Ada Text_IO but adds 
emulation support for terminals such as DEC VTxxx or ISO 6429. Using 
this package also means that your program no longer has to use the 
'console' subsystem of Windows. In particular, this means you can open 
multiple terminal windows from the same program if you need them.

The full package is available from 
http://members.optusnet.com.au/~rosshigson/terminal

Note that this package requires GNAT 3.14p or later, and also GWindows 
1.1 (more details in the distribution). If you do use it, then please 
let me know how it goes - I have tested it on all other versions of 
Windows and I believe it will work under Windows ME, but as I don't have 
a copy of ME I've never been able to verify this.

Ross.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-02 23:21   ` Ross Higson
@ 2004-10-02 23:52     ` Ross Higson
  2004-10-03  0:03       ` stephane richard
  0 siblings, 1 reply; 18+ messages in thread
From: Ross Higson @ 2004-10-02 23:52 UTC (permalink / raw)


Ross Higson wrote:

> stephane richard wrote:
> 
>> "GlesgaMick" <sikmick@yahoo.com> wrote in message 
>> news:d23e6915629caea950f8445632cbd448@localhost.talkaboutprogramming.com... 
>>
>>
>>> According to what iv'e read, the commands to clear the screen are:
>>>
>>> Ada.Text_IO.Put(Item => ASCII.ESC);
>>> Ada.Text_IO.Put(Item => "[2J");
>>>
>>> on my compuer they simply make the text value of ESC apear followed 
>>> by the
>>> [2J.  I'm using Windows ME at the command prompt. and suspect it has
>>> sometyhing to do with the way the OS recognised escape codes... but ca
>>> anyone direct me somewhere where i can find the right escape codes?
>>>
>>>
>>
>> I believe you need your ansi.sys driver installed (if that exists in 
>> XP :-).....it's a console problem. Only with ansi.sys installed (or 
>> emulated if it can) can these escape commands work.
>>
> The ansi.sys solution is sufficient if you only need to use the few 
> escape codes that were originally supported by DOS - luckily "ESC[2J" is 
> one of these. I'd certainly suggest you try that first.
> 
> However, if you can't get ansi.sys to work under Windows ME, or you want 
> or need to use some of the more sophisticated escape codes then I have a 
> package that is compatible with the standard Ada Text_IO but adds 
> emulation support for terminals such as DEC VTxxx or ISO 6429. Using 
> this package also means that your program no longer has to use the 
> 'console' subsystem of Windows. In particular, this means you can open 
> multiple terminal windows from the same program if you need them.
> 
> The full package is available from 
> http://members.optusnet.com.au/~rosshigson/terminal
> 
> Note that this package requires GNAT 3.14p or later, and also GWindows 
> 1.1 (more details in the distribution). If you do use it, then please 
> let me know how it goes - I have tested it on all other versions of 
> Windows and I believe it will work under Windows ME, but as I don't have 
> a copy of ME I've never been able to verify this.
> 
> Ross.

Sorry, should have pointed out - you don't need to go to the hassle of 
downloading or compiling GWindows just to see if my package will do the 
job for you. Just get the compiled version from the link above and 
execute your program using my 'redirect' utility. For example, if you 
are using GNAT and the standard GNAT 'diners' example program doesn't 
work (which it doesn't if you don't have ansi.sys installed), then you 
can instead say 'redirect diners'. This will run the diners program with 
its standard input/output redirected to a terminal window instead of a 
console window. This terminal window implements full VTxxx terminal 
emulation.

Ross.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-02 23:52     ` Ross Higson
@ 2004-10-03  0:03       ` stephane richard
  0 siblings, 0 replies; 18+ messages in thread
From: stephane richard @ 2004-10-03  0:03 UTC (permalink / raw)



"Ross Higson" <rosshigson_REMOVE_ME_@optusnet.com.au> wrote in message 
news:415f3ffe$0$23893$afc38c87@news.optusnet.com.au...
>
> Sorry, should have pointed out - you don't need to go to the hassle of 
> downloading or compiling GWindows just to see if my package will do the 
> job for you. Just get the compiled version from the link above and execute 
> your program using my 'redirect' utility. For example, if you are using 
> GNAT and the standard GNAT 'diners' example program doesn't work (which it 
> doesn't if you don't have ansi.sys installed), then you can instead say 
> 'redirect diners'. This will run the diners program with its standard 
> input/output redirected to a terminal window instead of a console window. 
> This terminal window implements full VTxxx terminal emulation.
>
> Ross.

Ahhhh...well I just learned something too :-)......now I know the usefulness 
of a terminal window instead of a console window....:-)....

Stephane Richard
"Ada World" webmaster
http://www.adaworld.com





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-02 12:58 ` stephane richard
  2004-10-02 13:02   ` stephane richard
  2004-10-02 23:21   ` Ross Higson
@ 2004-10-03  0:37   ` Brian May
  2004-10-03  1:03     ` Ross Higson
  2004-10-03 13:27     ` CBFalconer
  2 siblings, 2 replies; 18+ messages in thread
From: Brian May @ 2004-10-03  0:37 UTC (permalink / raw)


>>>>> "stephane" == stephane richard <stephane.richard@verizon.net> writes:

    stephane> I believe you need your ansi.sys driver installed (if
    stephane> that exists in XP :-).....it's a console problem. Only
    stephane> with ansi.sys installed (or emulated if it can) can
    stephane> these escape commands work.

Another solution might be to use an alternative console, e.g. rxvt
that comes supplied with msys/mingw32. I doubt it requires ANSI.SYS...

On a related topic, anyone know how Windows sets priorities on
applications?

I have a command line application (Ada of course), run in a MS console
window. It is a daemon, so is meant to run in the background, without
any user access required.

However, I have been getting complaints that it stops working if the
window isn't visible (e.g. covered by another window). If another
window pops up in front of it, it stops working. Also power save mode
on the monitor stops it working (or was that the screen saver?). The
confusing part is that sometimes it does work.

I haven't seen the problem, and can't reproduce it on Windows XP (the
computer in question is Windows 2000 IIRC).

My theory is that MS-Windows reduces the priority of the task if the
window is not visible on the assumption that the user doesn't need to
interact with Windows they can't see.

I have a suspicion that using rxvt might solve the problem (and will
check this ASAP), but I don't know how priorities are set on Windows.
-- 
Brian May <bam@snoopy.apana.org.au>



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-03  0:37   ` Brian May
@ 2004-10-03  1:03     ` Ross Higson
  2004-10-03 13:27     ` CBFalconer
  1 sibling, 0 replies; 18+ messages in thread
From: Ross Higson @ 2004-10-03  1:03 UTC (permalink / raw)


Brian May wrote:

> 
> On a related topic, anyone know how Windows sets priorities on
> applications?
> 
> I have a command line application (Ada of course), run in a MS console
> window. It is a daemon, so is meant to run in the background, without
> any user access required.
> 
> However, I have been getting complaints that it stops working if the
> window isn't visible (e.g. covered by another window). If another
> window pops up in front of it, it stops working. Also power save mode
> on the monitor stops it working (or was that the screen saver?). The
> confusing part is that sometimes it does work.
> 
> I haven't seen the problem, and can't reproduce it on Windows XP (the
> computer in question is Windows 2000 IIRC).
> 
> My theory is that MS-Windows reduces the priority of the task if the
> window is not visible on the assumption that the user doesn't need to
> interact with Windows they can't see.
> 
> I have a suspicion that using rxvt might solve the problem (and will
> check this ASAP), but I don't know how priorities are set on Windows.

Brian,

Under NT/2000 the current fg process may indeed get a priority boost 
that can cause bg processes to slow down. I don't think using rxvt will 
help, but this behaviour can be disabled. It doesn't happen under XP.

See http://www.winguides.com/registry/display.php/877/

Ross.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-03  0:37   ` Brian May
  2004-10-03  1:03     ` Ross Higson
@ 2004-10-03 13:27     ` CBFalconer
  2004-10-03 22:46       ` Brian May
  1 sibling, 1 reply; 18+ messages in thread
From: CBFalconer @ 2004-10-03 13:27 UTC (permalink / raw)


Brian May wrote:
> 
... snip ...
> 
> My theory is that MS-Windows reduces the priority of the task if the
> window is not visible on the assumption that the user doesn't need to
> interact with Windows they can't see.

Dos boxes (command line windows) have an alterable property, which
pauses anything when the window is not active.

-- 
Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
   <http://cbfalconer.home.att.net>  USE worldnet address!




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-03 13:27     ` CBFalconer
@ 2004-10-03 22:46       ` Brian May
  0 siblings, 0 replies; 18+ messages in thread
From: Brian May @ 2004-10-03 22:46 UTC (permalink / raw)


>>>>> "CBFalconer" == CBFalconer  <cbfalconer@yahoo.com> writes:

    CBFalconer> Dos boxes (command line windows) have an alterable
    CBFalconer> property, which pauses anything when the window is not
    CBFalconer> active.

Thats what I thought too; I have looked through all the properties for
the window, but can't find anything like this one. Maybe Windows 2000
doesn't allow you to change it?

Anyway, I have a number of things to try out now next time I am on
site:

* Registry hack at http://www.winguides.com/registry/display.php/877/.

* Use rxvt instead of DOS box.

* Make note of following: command.com depends on the NTVDM (16 bit
  virtual process); cmd.exe doesn't (32 bit process).
-- 
Brian May <bam@snoopy.apana.org.au>



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-02 12:55 Why do the escape sequences not work? GlesgaMick
  2004-10-02 12:58 ` stephane richard
@ 2004-10-05 17:45 ` GlesgaMick
  2004-10-05 19:15   ` Marc A. Criley
                     ` (2 more replies)
  1 sibling, 3 replies; 18+ messages in thread
From: GlesgaMick @ 2004-10-05 17:45 UTC (permalink / raw)


ok, i ultimately solved the problem of ansi.sys not being allowed on WinME
by formatting and installing Win98... which i guess i will be using for
the duration of studying Ada... so much for the whole 'ada is great
because of its compatibilty' line.

Apparently microsoft deliberately removed real mode capabilities from
WinME.  This is the difference between it and 98.  The spoils of this
move...?  a WinME computer boots up 4 seconds faster than a 98




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-05 17:45 ` GlesgaMick
@ 2004-10-05 19:15   ` Marc A. Criley
  2004-10-05 19:32   ` Frank J. Lhota
  2004-10-05 19:54   ` Jeffrey Carter
  2 siblings, 0 replies; 18+ messages in thread
From: Marc A. Criley @ 2004-10-05 19:15 UTC (permalink / raw)


"GlesgaMick" <sikmick@yahoo.com> wrote:
> so much for the whole 'ada is great
> because of its compatibilty' line.

Umm, this problem has nothing to do with Ada.  You were relying on certain
Windows platform functionality being present, and that changed between
Windows OS incarnations.  The same problem would have occurred with any
programming language.

Marc A. Criley
McKae Technologies
www.mckae.com





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-05 17:45 ` GlesgaMick
  2004-10-05 19:15   ` Marc A. Criley
@ 2004-10-05 19:32   ` Frank J. Lhota
  2004-10-05 19:54   ` Jeffrey Carter
  2 siblings, 0 replies; 18+ messages in thread
From: Frank J. Lhota @ 2004-10-05 19:32 UTC (permalink / raw)


"GlesgaMick" <sikmick@yahoo.com> wrote in message 
news:7f61ac7a48fbdc189d806643ca3043bb@localhost.talkaboutprogramming.com...
> ok, i ultimately solved the problem of ansi.sys not being allowed on WinME
> by formatting and installing Win98... which i guess i will be using for
> the duration of studying Ada... so much for the whole 'ada is great
> because of its compatibilty' line.

The whole ANSI escape sequence stuff  is OS specific, and not part of the 
Ada standard.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Why do the escape sequences not work?
  2004-10-05 17:45 ` GlesgaMick
  2004-10-05 19:15   ` Marc A. Criley
  2004-10-05 19:32   ` Frank J. Lhota
@ 2004-10-05 19:54   ` Jeffrey Carter
  2 siblings, 0 replies; 18+ messages in thread
From: Jeffrey Carter @ 2004-10-05 19:54 UTC (permalink / raw)


GlesgaMick wrote:

> ok, i ultimately solved the problem of ansi.sys not being allowed on WinME
> by formatting and installing Win98... which i guess i will be using for
> the duration of studying Ada... so much for the whole 'ada is great
> because of its compatibilty' line.

This has nothing to do with Ada. A C program that output ANSI escape 
sequences would give the same results.

You could have taken an easier route by downloading and using the 
redirect program mentioned earlier, or by obtaining J. van Dijk's 
NT_Console package, which works with all flavors of Windows, but is not 
portable to other OSes.

http://users.ncrvnet.nl/gmvdijk/packages.html

-- 
Jeff Carter
"We burst our pimples at you."
Monty Python & the Holy Grail
16




^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2004-10-05 19:54 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-02 12:55 Why do the escape sequences not work? GlesgaMick
2004-10-02 12:58 ` stephane richard
2004-10-02 13:02   ` stephane richard
2004-10-02 13:11     ` stephane richard
2004-10-02 13:37       ` GlesgaMick
2004-10-02 14:34         ` Marius Amado Alves
2004-10-02 14:37         ` stephane richard
2004-10-02 23:21   ` Ross Higson
2004-10-02 23:52     ` Ross Higson
2004-10-03  0:03       ` stephane richard
2004-10-03  0:37   ` Brian May
2004-10-03  1:03     ` Ross Higson
2004-10-03 13:27     ` CBFalconer
2004-10-03 22:46       ` Brian May
2004-10-05 17:45 ` GlesgaMick
2004-10-05 19:15   ` Marc A. Criley
2004-10-05 19:32   ` Frank J. Lhota
2004-10-05 19:54   ` Jeffrey Carter

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