comp.lang.ada
 help / color / mirror / Atom feed
From: aurele.vitali@sympatico.ca (Aurele Vitali)
Subject: Re: GNAT Ada - Clear Screen
Date: 19 Apr 2003 09:25:00 -0700
Date: 2003-04-19T16:25:00+00:00	[thread overview]
Message-ID: <5600f988.0304190824.677aa701@posting.google.com> (raw)
In-Reply-To: 9e6oa.5034$8g5.77486@news2.e.nsc.no

"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



      reply	other threads:[~2003-04-19 16:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]
replies disabled

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