comp.lang.ada
 help / color / mirror / Atom feed
* Re: Clear Screen command
@ 1998-03-04  0:00 Jeremy Mlazovsky
  1998-03-05  0:00 ` William D. Ghrist
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jeremy Mlazovsky @ 1998-03-04  0:00 UTC (permalink / raw)



I'm sorry, I forgot to add a few details...

I am using GNAT 3.01 or whatever the most recent version is.

I'm using ADA95

I am using ADAGIDE v6.10c on Windows 95 machine with 32 megs of RAM

After posting my last message, I found a simple CLEARSCREEN procedure in a
package included with GNAT.  I'll use that unless some one knows how to do
it better.  Thanks

Jeremy

mlazovjp@flyernet.udayton.edu






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

* Re: Clear Screen command
  1998-03-04  0:00 Clear Screen command Jeremy Mlazovsky
@ 1998-03-05  0:00 ` William D. Ghrist
  1998-03-05  0:00 ` John J. Cupak Jr.
  1998-03-05  0:00 ` Robert Dewar
  2 siblings, 0 replies; 5+ messages in thread
From: William D. Ghrist @ 1998-03-05  0:00 UTC (permalink / raw)



Jeremy Mlazovsky wrote:
> 
> I'm sorry, I forgot to add a few details...
> 
> I am using GNAT 3.01 or whatever the most recent version is.
> 
> I'm using ADA95
> 
> I am using ADAGIDE v6.10c on Windows 95 machine with 32 megs of RAM
> 
> After posting my last message, I found a simple CLEARSCREEN procedure in a
> package included with GNAT.  I'll use that unless some one knows how to do
> it better.  Thanks
> 
> Jeremy
> 
> mlazovjp@flyernet.udayton.edu

Jeremy,

You might want to check out the NT/Win95 console package written by
Jerry van Dijk.  You can find it at
http://stad.dsl.nl/~jvandyk/
This has a clear screen procedure and also has cursor and color control
procedures.  I don't know whether there is any way to "lock" the top of
the screen, but you could emulate that by using the cursor control to
re-write the top line(s) after every output.

Regards,
Bill Ghrist






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

* Re: Clear Screen command
  1998-03-04  0:00 Clear Screen command Jeremy Mlazovsky
  1998-03-05  0:00 ` William D. Ghrist
@ 1998-03-05  0:00 ` John J. Cupak Jr.
  1998-03-05  0:00   ` Jerry van Dijk
  1998-03-05  0:00 ` Robert Dewar
  2 siblings, 1 reply; 5+ messages in thread
From: John J. Cupak Jr. @ 1998-03-05  0:00 UTC (permalink / raw)
  To: Jeremy Mlazovsky

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

Jeremy Mlazovsky wrote:
> 
> I'm sorry, I forgot to add a few details...
> 
> I am using GNAT 3.01 or whatever the most recent version is.
> 
> I'm using ADA95
> 
> I am using ADAGIDE v6.10c on Windows 95 machine with 32 megs of RAM
> 
> After posting my last message, I found a simple CLEARSCREEN procedure in a
> package included with GNAT.  I'll use that unless some one knows how to do
> it better.  Thanks
> 
> Jeremy
> 
> mlazovjp@flyernet.udayton.edu

Yup, you can use the attached Ada 95 packages and child packages.

You can figure out how to encapsulate the other screen controls
in like manner

-- 
--------------------------------------------------------------
-                 John J. Cupak Jr, CCP                      -
- Raytheon Systems Company - Software Engineering Laboratory -
- tel: 508-858-1222   email (work): jcj@swl.msd.ray.com      -
- fax: 508-858-4336   email (home): jcupak@aol.com           -
--------------------------------------------------------------

[-- Attachment #2: screen.ads --]
[-- Type: text/plain, Size: 819 bytes --]

----------------------------------------------------------------------
--  The Screen Package (Specification)
--
--  Programmer : John Cupak
--  History    :  6Oct97 jcj Created
--               17Oct97 jcj "Base" types package 
--  Description: This package defines the xterm/VT100 size
----------------------------------------------------------------------

   package Screen is
   
      Maximum_Rows    : constant := 24;
      Maximum_Columns : constant := 80;
   
      subtype Rows    is Positive range 1..Maximum_Rows;
      subtype Columns is Positive range 1..Maximum_Columns;
   
   private
   
      -- Define constant for use by all child packages
   
      -- Command Sequence Introducer (CSI)
      -- (provides screen command prefix)
   
      CSI : constant String := ASCII.ESC & "[";
   
   end Screen;

[-- Attachment #3: screen-cursor.ads --]
[-- Type: text/plain, Size: 995 bytes --]

----------------------------------------------------------------------
--  The Screen Cursor Control Child Package (Specification)
--
--  Programmer : John Cupak
--  History    : 17Oct97 jcj Created
--  Description: Moves cursor from current position
----------------------------------------------------------------------

   package Screen.Cursor is
   
      -- Move cursor "By" times - stop at top
      procedure Up   (By : in Positive := 1);
   
      -- Move cursor down "By" times - stop at bottom
      procedure Down (By : in Positive := 1);
   
      -- Move cursor right "By" times - stop at far right
      procedure Right(By : in Positive := 1);
   
      -- Move cursor left "By" times - stop at far left
      procedure Left (By : in Positive := 1);
   
      -- Set cursor position - Column=X, Row=Y
      procedure Position(Column : Columns;  
                         Row    : Rows   ); -- Line
   
      -- Set cursor home (1,1)
      procedure Home;
   
   end Screen.Cursor;

[-- Attachment #4: screen-cursor.adb --]
[-- Type: text/plain, Size: 1061 bytes --]

   with Ada.Text_IO;
   with Ada.Integer_Text_IO;

   use Ada.Text_IO;
   use Ada.Integer_Text_IO;

   package body Screen.Cursor is
   
      procedure Up   (By : in Positive := 1) is
      begin
         Put(CSI);Put(By,0);Put("A");
      end Up;
   
      procedure Down (By : in Positive := 1) is
      begin
         Put(CSI);Put(By,0);Put("B");
      end Down;
   
      procedure Right(By : in Positive := 1) is
      begin
         Put(CSI);Put(By,0);Put("C");
      end Right;
   
      procedure Left (By : in Positive := 1) is
      begin
         Put(CSI);Put(By,0);Put("D");
      end Left;
   
      procedure Position(Column : in Columns;
                         Row    : in Rows   ) is
      
      begin                                                
         Put(Item => CSI);
         Put(Item => Row,    Width => 0);
         Put(Item => ';');
         Put(Item => Column, Width => 0);
         Put(Item => 'H');
      end Position;
   
      procedure Home is
      begin
         Put(CSI & "H");
      end Home;
   
   end Screen.Cursor;

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

* Re: Clear Screen command
  1998-03-04  0:00 Clear Screen command Jeremy Mlazovsky
  1998-03-05  0:00 ` William D. Ghrist
  1998-03-05  0:00 ` John J. Cupak Jr.
@ 1998-03-05  0:00 ` Robert Dewar
  2 siblings, 0 replies; 5+ messages in thread
From: Robert Dewar @ 1998-03-05  0:00 UTC (permalink / raw)



Jeremy says

<<I am using GNAT 3.01 or whatever the most recent version is.
>>

This is a bit like someone saying they are using DOS version 2.1 or whatever
the most recent version is. 3.01 is VERY ancient. Perhaps you should check
exactly which version you *are* using, use -gnatv.






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

* Re: Clear Screen command
  1998-03-05  0:00 ` John J. Cupak Jr.
@ 1998-03-05  0:00   ` Jerry van Dijk
  0 siblings, 0 replies; 5+ messages in thread
From: Jerry van Dijk @ 1998-03-05  0:00 UTC (permalink / raw)



> > I am using ADAGIDE v6.10c on Windows 95 machine with 32 megs of RAM
> > 
> > After posting my last message, I found a simple CLEARSCREEN
procedure in a
> > package included with GNAT.  I'll use that unless some one knows
how to do
> > it better.  Thanks

A package with some basic console control that works on either Win95
and
NT can be downloaded from my homepage: http://stad.dsl.nl/~jvandyk

Jerry.





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

end of thread, other threads:[~1998-03-05  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-04  0:00 Clear Screen command Jeremy Mlazovsky
1998-03-05  0:00 ` William D. Ghrist
1998-03-05  0:00 ` John J. Cupak Jr.
1998-03-05  0:00   ` Jerry van Dijk
1998-03-05  0:00 ` Robert Dewar

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