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
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.
> _______________________________________________
> comp.lang.ada mailing list
> comp.l...@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>
>
//David Holm
> 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
"Fingertip" <kam...@deletethispart.actcom.co.il> wrote in message
news:newscache$828jdh$1ko$1...@lnews.actcom.co.il...
> 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
"AdaGIDE v. 6.22.10"
Thanks in advance,
Fingertip
This is the IDE you are using, not the compiler.
Preben
> This is the IDE you are using, not the compiler.
>
> Preben
Oh...
Erm, then maybe it is "GNATMAKE 3.12P"?
Thanks again,
Fingertip
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
> 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.
> 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.
> 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
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
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