comp.lang.ada
 help / color / mirror / Atom feed
* GNAT Ada - Clear Screen
@ 2003-04-18  9:05 Fingertip
  2003-04-18  9:19 ` David C. Hoos, Sr.
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Fingertip @ 2003-04-18  9:05 UTC (permalink / raw)


Hello everyone,

This is the first time I post here, so I hope I don't violate any 
guidelines and/or rules you guys set here.

Now, for my question:

I am using a GNAT Ada compiler, and I want to be able to clear the console 
window.

I've searched the net for some solutions, but the only solutions I found 
were:
ADA.TEXT_IO.NEW_PAGE;

And:
ADA.TEXT_IO.NEW_LINE (24);

The first solution doesn't really work. It just outputs the ASCII.FF char, 
but it doesn't do anything.

The second solution isn't much help, because it moves the marker to the 
bottom of the screen. When I try to get it back to the top with:
ADA.TEXT_IO.SET_COL  (1);
ADA.TEXT_IO.SET_LINE (1);

It outputs the ASCII.FF character again, but does nothing else.

I would appreciate any help you have to offer.

Thanks in advace,
Fingertip



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

* Re: GNAT Ada - Clear Screen
  2003-04-18  9:05 GNAT Ada - Clear Screen Fingertip
@ 2003-04-18  9:19 ` David C. Hoos, Sr.
  2003-04-18 10:01   ` Fingertip
  2003-04-18 10:01 ` David Holm
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: David C. Hoos, Sr. @ 2003-04-18  9:19 UTC (permalink / raw)
  To: comp.lang.ada mail to news gateway; +Cc: kammar

Your problem is not an Ada (language) issue, but an OS issue.
You would have the same problem with any language.

Rather than go into all of the possibilities, if you can
tell us what OS you're using, and what Ada compiler, we'll
be able to give you more directed help.

----- Original Message ----- 
From: "Fingertip" <kammar@deletethispart.actcom.co.il>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: April 18, 2003 4:05 AM
Subject: GNAT Ada - Clear Screen


> Hello everyone,
> 
> This is the first time I post here, so I hope I don't violate any 
> guidelines and/or rules you guys set here.
> 
> Now, for my question:
> 
> I am using a GNAT Ada compiler, and I want to be able to clear the console 
> window.
> 
> I've searched the net for some solutions, but the only solutions I found 
> were:
> ADA.TEXT_IO.NEW_PAGE;
> 
> And:
> ADA.TEXT_IO.NEW_LINE (24);
> 
> The first solution doesn't really work. It just outputs the ASCII.FF char, 
> but it doesn't do anything.
> 
> The second solution isn't much help, because it moves the marker to the 
> bottom of the screen. When I try to get it back to the top with:
> ADA.TEXT_IO.SET_COL  (1);
> ADA.TEXT_IO.SET_LINE (1);
> 
> It outputs the ASCII.FF character again, but does nothing else.
> 
> I would appreciate any help you have to offer.
> 
> Thanks in advace,
> Fingertip
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
> 
> 




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

* Re: GNAT Ada - Clear Screen
  2003-04-18  9:19 ` David C. Hoos, Sr.
@ 2003-04-18 10:01   ` Fingertip
  2003-04-18 16:47     ` tmoran
  0 siblings, 1 reply; 17+ messages in thread
From: Fingertip @ 2003-04-18 10:01 UTC (permalink / raw)


"David C. Hoos, Sr." <david.c.hoos.sr@ada95.com> wrote in
news:mailman.2.1050657623.25854.comp.lang.ada@ada.eu.org: 

> Your problem is not an Ada (language) issue, but an OS issue.
> You would have the same problem with any language.
> 
> Rather than go into all of the possibilities, if you can
> tell us what OS you're using, and what Ada compiler, we'll
> be able to give you more directed help.


WinME.

But I want it to run on other WinX OS...

Thanks!

Fingertip



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

* Re: GNAT Ada - Clear Screen
  2003-04-18  9:05 GNAT Ada - Clear Screen Fingertip
  2003-04-18  9:19 ` David C. Hoos, Sr.
@ 2003-04-18 10:01 ` David Holm
  2003-04-18 11:02   ` Fingertip
  2003-04-18 10:55 ` Jeffrey Creem
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: David Holm @ 2003-04-18 10:01 UTC (permalink / raw)


Hi,
there is an ncurses binding for Ada. I suggest you get that if you want to be able to do
advanced console manipulations that work on all kinds of terminals.

//David Holm

On Fri, 18 Apr 2003 09:05:44 GMT
Fingertip <kammar@deletethispart.actcom.co.il> wrote:

> Hello everyone,
> 
> This is the first time I post here, so I hope I don't violate any 
> guidelines and/or rules you guys set here.
> 
> Now, for my question:
> 
> I am using a GNAT Ada compiler, and I want to be able to clear the console 
> window.
> 
> I've searched the net for some solutions, but the only solutions I found 
> were:
> ADA.TEXT_IO.NEW_PAGE;
> 
> And:
> ADA.TEXT_IO.NEW_LINE (24);
> 
> The first solution doesn't really work. It just outputs the ASCII.FF char, 
> but it doesn't do anything.
> 
> The second solution isn't much help, because it moves the marker to the 
> bottom of the screen. When I try to get it back to the top with:
> ADA.TEXT_IO.SET_COL  (1);
> ADA.TEXT_IO.SET_LINE (1);
> 
> It outputs the ASCII.FF character again, but does nothing else.
> 
> I would appreciate any help you have to offer.
> 
> Thanks in advace,
> Fingertip



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

* Re: GNAT Ada - Clear Screen
  2003-04-18  9:05 GNAT Ada - Clear Screen Fingertip
  2003-04-18  9:19 ` David C. Hoos, Sr.
  2003-04-18 10:01 ` David Holm
@ 2003-04-18 10:55 ` Jeffrey Creem
  2003-04-18 14:25 ` Fingertip
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 17+ messages in thread
From: Jeffrey Creem @ 2003-04-18 10:55 UTC (permalink / raw)


Note that the ncurses binding is built in to the later ncurses distributions
so you dont have to go
looking for it.

ftp://ftp.gnu.org/gnu/ncurses

"Fingertip" <kammar@deletethispart.actcom.co.il> wrote in message
news:newscache$828jdh$1ko$1@lnews.actcom.co.il...
> Hello everyone,
>
> This is the first time I post here, so I hope I don't violate any
> guidelines and/or rules you guys set here.
>
> Now, for my question:
>
> I am using a GNAT Ada compiler, and I want to be able to clear the console
> window.






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

* Re: GNAT Ada - Clear Screen
  2003-04-18 10:01 ` David Holm
@ 2003-04-18 11:02   ` Fingertip
  2003-04-19  1:05     ` David Holm
  2003-04-19  3:40     ` Steve
  0 siblings, 2 replies; 17+ messages in thread
From: Fingertip @ 2003-04-18 11:02 UTC (permalink / raw)


David Holm <david@realityrift.com> wrote in
news:20030418120111.2cea818c.david@realityrift.com: 

> Hi,
> there is an ncurses binding for Ada. I suggest you get that if you
> want to be able to do advanced console manipulations that work on all
> kinds of terminals. 
> 
> //David Holm
> 

As a beginner programmer in ada, can you be a bit more specific?

What is a binding? Where can I find the one you are talking about?

Thanks!

Fingertip



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

* Re: GNAT Ada - Clear Screen
  2003-04-18  9:05 GNAT Ada - Clear Screen Fingertip
                   ` (2 preceding siblings ...)
  2003-04-18 10:55 ` Jeffrey Creem
@ 2003-04-18 14:25 ` Fingertip
  2003-04-18 14:36   ` Preben Randhol
  2003-04-18 19:06 ` Richard Riehle
  2003-04-19  6:43 ` Tarjei T. Jensen
  5 siblings, 1 reply; 17+ messages in thread
From: Fingertip @ 2003-04-18 14:25 UTC (permalink / raw)


Hmm... I thought GNAT Ada explained enough about the compiler. Apparently I 
was wrong. So, the exact version is:

"AdaGIDE v. 6.22.10"

Thanks in advance,
Fingertip



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

* Re: GNAT Ada - Clear Screen
  2003-04-18 14:25 ` Fingertip
@ 2003-04-18 14:36   ` Preben Randhol
  2003-04-18 14:56     ` Fingertip
  0 siblings, 1 reply; 17+ messages in thread
From: Preben Randhol @ 2003-04-18 14:36 UTC (permalink / raw)


Fingertip wrote:
> Hmm... I thought GNAT Ada explained enough about the compiler. Apparently I 
> was wrong. So, the exact version is:
> 
> "AdaGIDE v. 6.22.10"

This is the IDE you are using, not the compiler.

Preben



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

* Re: GNAT Ada - Clear Screen
  2003-04-18 14:36   ` Preben Randhol
@ 2003-04-18 14:56     ` Fingertip
  2003-04-18 15:15       ` Preben Randhol
  0 siblings, 1 reply; 17+ messages in thread
From: Fingertip @ 2003-04-18 14:56 UTC (permalink / raw)


Preben Randhol <randhol+news@pvv.org> wrote in
news:slrnba03ar.rkc.randhol+news@kiuk0152.chembio.ntnu.no: 

> This is the IDE you are using, not the compiler.
> 
> Preben

Oh...

Erm, then maybe it is "GNATMAKE 3.12P"?

Thanks again,
Fingertip



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

* Re: GNAT Ada - Clear Screen
  2003-04-18 14:56     ` Fingertip
@ 2003-04-18 15:15       ` Preben Randhol
  0 siblings, 0 replies; 17+ messages in thread
From: Preben Randhol @ 2003-04-18 15:15 UTC (permalink / raw)


Fingertip wrote:
> Preben Randhol <randhol+news@pvv.org> wrote in
> news:slrnba03ar.rkc.randhol+news@kiuk0152.chembio.ntnu.no: 
> 
>> This is the IDE you are using, not the compiler.
>> 
>> Preben
> 
> Oh...
> 
> Erm, then maybe it is "GNATMAKE 3.12P"?

Yes sound correct. I recommend you upgrade to Gnat 3.15p as Gnat 3.12p
is very old. 

You can find it here: http://libre.act-europe.fr/GNAT/

Preben



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

* Re: GNAT Ada - Clear Screen
  2003-04-18 10:01   ` Fingertip
@ 2003-04-18 16:47     ` tmoran
  2003-04-18 17:54       ` Michael Bode
  0 siblings, 1 reply; 17+ messages in thread
From: tmoran @ 2003-04-18 16:47 UTC (permalink / raw)


> WinME.
If that will support ANSI.SYS in text mode, go to www.adaic.com
and search for  "ansi terminal emulator"

> But I want it to run on other WinX OS...
  I note "ansi.sys" is present in my w2k's winnt\system32 directory, but
I haven't actually tried it.  Windows really prefers that you use their
GUI rather than text mode.



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

* Re: GNAT Ada - Clear Screen
  2003-04-18 16:47     ` tmoran
@ 2003-04-18 17:54       ` Michael Bode
  0 siblings, 0 replies; 17+ messages in thread
From: Michael Bode @ 2003-04-18 17:54 UTC (permalink / raw)


tmoran@acm.org writes:

>   I note "ansi.sys" is present in my w2k's winnt\system32 directory, but
> I haven't actually tried it.  Windows really prefers that you use their
> GUI rather than text mode.

This is only for DOS apps. It is not used for Windows apps. You need a
DOS Ada compiler to use ANSI escape codes with NT. The proper
functions for Windows apps are the Windows console API. Specifically
to clear the console screen in Windows use this method:
http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b99261

-- 
Fï¿œr OE User: http://learn.to/quote/
OE users please read http://www.uwasa.fi/~ts/http/quote.html
PGP Key: http://home.t-online.de/home/michael_bode/
Legal Disclaimer: Wer Sarkasmus findet, darf ihn behalten.



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

* Re: GNAT Ada - Clear Screen
  2003-04-18  9:05 GNAT Ada - Clear Screen Fingertip
                   ` (3 preceding siblings ...)
  2003-04-18 14:25 ` Fingertip
@ 2003-04-18 19:06 ` Richard Riehle
  2003-04-19  6:43 ` Tarjei T. Jensen
  5 siblings, 0 replies; 17+ messages in thread
From: Richard Riehle @ 2003-04-18 19:06 UTC (permalink / raw)


Fingertip wrote:

> I am using a GNAT Ada compiler, and I want to be able to clear the console
> window.

Dowload a copy of NT_Console or Console_IO, both of which will be
more fund to use than Ada.Text_IO on a Windows platform.   These
are written by Jerry Van Dijk.  I think both are available from either
of the Ada web sites.

Richard Riehle




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

* Re: GNAT Ada - Clear Screen
  2003-04-18 11:02   ` Fingertip
@ 2003-04-19  1:05     ` David Holm
  2003-04-19  3:40     ` Steve
  1 sibling, 0 replies; 17+ messages in thread
From: David Holm @ 2003-04-19  1:05 UTC (permalink / raw)


http://md.uniyar.ac.ru/gsh/docs/ncurses/

On Fri, 18 Apr 2003 11:02:45 GMT
Fingertip <kammar@deletethispart.actcom.co.il> wrote:

> David Holm <david@realityrift.com> wrote in
> news:20030418120111.2cea818c.david@realityrift.com: 
> 
> > Hi,
> > there is an ncurses binding for Ada. I suggest you get that if you
> > want to be able to do advanced console manipulations that work on all
> > kinds of terminals. 
> > 
> > //David Holm
> > 
> 
> As a beginner programmer in ada, can you be a bit more specific?
> 
> What is a binding? Where can I find the one you are talking about?
> 
> Thanks!
> 
> Fingertip



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

* Re: GNAT Ada - Clear Screen
  2003-04-18 11:02   ` Fingertip
  2003-04-19  1:05     ` David Holm
@ 2003-04-19  3:40     ` Steve
  1 sibling, 0 replies; 17+ messages in thread
From: Steve @ 2003-04-19  3:40 UTC (permalink / raw)


"Fingertip" <kammar@deletethispart.actcom.co.il> wrote in message
news:newscache$ahdjdh$dso$1@lnews.actcom.co.il...
> David Holm <david@realityrift.com> wrote in
> news:20030418120111.2cea818c.david@realityrift.com:
>
> > Hi,
> > there is an ncurses binding for Ada. I suggest you get that if you
> > want to be able to do advanced console manipulations that work on all
> > kinds of terminals.
> >
> > //David Holm
> >
>
> As a beginner programmer in ada, can you be a bit more specific?
>
> What is a binding? Where can I find the one you are talking about?

Some things you would like to program which are not "built in" to the
programming language (like clearing the screen).  To perform these
operations you must call routines that are not built into the language, and
are operating system specific.

"Bindings" refer to the code that permit you to access libraries from Ada.

A good source of bindings and general information is found at:
  http://www.adapower.com

You'll also find a lot of links to other good sites there.

For clearing the screen go to:

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

And take a look at the NT/Win95 Console package.

I think it has what you're looking for.

Steve
(The Duck)

> Thanks!
>
> Fingertip





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

* Re: GNAT Ada - Clear Screen
  2003-04-18  9:05 GNAT Ada - Clear Screen Fingertip
                   ` (4 preceding siblings ...)
  2003-04-18 19:06 ` Richard Riehle
@ 2003-04-19  6:43 ` Tarjei T. Jensen
  2003-04-19 16:25   ` Aurele Vitali
  5 siblings, 1 reply; 17+ messages in thread
From: Tarjei T. Jensen @ 2003-04-19  6:43 UTC (permalink / raw)



"Fingertip" wrote:
> I am using a GNAT Ada compiler, and I want to be able to clear the console
> window.

There is a solution. You will have to search this newsgroup. Search this
group for the name "Jerry van Dijk". He has created a NT console package.

BTW I have not used it.

greetings,






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

* Re: GNAT Ada - Clear Screen
  2003-04-19  6:43 ` Tarjei T. Jensen
@ 2003-04-19 16:25   ` Aurele Vitali
  0 siblings, 0 replies; 17+ messages in thread
From: Aurele Vitali @ 2003-04-19 16:25 UTC (permalink / raw)


"Tarjei T. Jensen" <tarjei@online.no> wrote in message news:<9e6oa.5034$8g5.77486@news2.e.nsc.no>...
> "Fingertip" wrote:
> > I am using a GNAT Ada compiler, and I want to be able to clear the console
> > window.
> 
> There is a solution. You will have to search this newsgroup. Search this
> group for the name "Jerry van Dijk". He has created a NT console package.
> 
> BTW I have not used it.
> 
> greetings,

Here a quick way of clearing the screen on NT:

  function Command_Interpreter( Command : in Interfaces.C.Strings.Chars_Ptr )
                                return Interfaces.C.Int; 
  pragma import( c, Command_Interpreter, "system" );

  -- Set_Console_Mode: This function sets the number of lines and columns 

  procedure Set_Console_Mode is
    iResult : Interfaces.C.Int;
  begin
    iResult := Command_Interpreter( Interfaces.C.Strings.New_String( 
                          "MODE CON COLS=80 LINES=25" ) );
  end Set_Console_Mode;

  -- Clear_Screen: This function clears the screen 

  procedure Clear_Screen is
    iResult : Interfaces.C.Int;
  begin
    iResult := Command_Interpreter( Interfaces.C.Strings.New_String( "CLS" ) );
  end Clear_Screen;

Cheers
Aurele



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

end of thread, other threads:[~2003-04-19 16:25 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-18  9:05 GNAT Ada - Clear Screen Fingertip
2003-04-18  9:19 ` David C. Hoos, Sr.
2003-04-18 10:01   ` Fingertip
2003-04-18 16:47     ` tmoran
2003-04-18 17:54       ` Michael Bode
2003-04-18 10:01 ` David Holm
2003-04-18 11:02   ` Fingertip
2003-04-19  1:05     ` David Holm
2003-04-19  3:40     ` Steve
2003-04-18 10:55 ` Jeffrey Creem
2003-04-18 14:25 ` Fingertip
2003-04-18 14:36   ` Preben Randhol
2003-04-18 14:56     ` Fingertip
2003-04-18 15:15       ` Preben Randhol
2003-04-18 19:06 ` Richard Riehle
2003-04-19  6:43 ` Tarjei T. Jensen
2003-04-19 16:25   ` Aurele Vitali

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