comp.lang.ada
 help / color / mirror / Atom feed
From: David Starner <dvdeug@x8b4e53cd.dhcp.okstate.edu>
Subject: Re: Some general help with Ada
Date: 10 Mar 2002 00:57:30 GMT
Date: 2002-03-10T00:57:30+00:00	[thread overview]
Message-ID: <a6eb1q$9281@news.cis.okstate.edu> (raw)
In-Reply-To: kDti8.3523$y76.752306@news6-win.server.ntlworld.com

On Sat, 9 Mar 2002 19:46:38 -0000, chris.danx <chris.danx@ntlworld.com> wrote:
> "Jim" <genx54321@hotmail.com> wrote in message
> news:ab6237e2.0203091102.103d54e9@posting.google.com...
>> how do you create a blank screen like the CLS command in Qbasic/DOS ?
>>
>> can you do it with text_io ?
> 
> ada.text_io.new_line (26); is quick and easy.

And wrong. There's no guarentee that the terminal is only 26 lines tall.
I frequently work in terminals 50 lines tall, for example. It will also
look very different from clearing the screen on some terminals.  There
is no way to do this in standard Ada that will always work.
Ada.Text_IO.Put (ASCII.ESC & "[2J"); will work on ANSI terminals,
including ANSI.SYS on DOS. You might want to look at the GNAT examples;
that has a very simple terminal package in it. For bigger stuff, you
probably want to look at the Ada binding to NCurses included in the
package.

-- 
David Starner - starner@okstate.edu
"It's not a habit; it's cool; I feel alive. 
If you don't have it you're on the other side." 
- K's Choice (probably refering to the Internet)



  reply	other threads:[~2002-03-10  0:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-09 19:02 Some general help with ADA Jim
2002-03-09 19:46 ` Some general help with Ada chris.danx
2002-03-10  0:57   ` David Starner [this message]
2002-04-08  0:43     ` Nick Roberts
2002-03-09 20:13 ` Some general help with ADA Adrian Knoth
replies disabled

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