comp.lang.ada
 help / color / mirror / Atom feed
* Displaying positional text
@ 1996-07-26  0:00 1Lt Joel Rudy
  1996-07-28  0:00 ` Robert Dewar
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: 1Lt Joel Rudy @ 1996-07-26  0:00 UTC (permalink / raw)



Is there an Ada95 package that allows you to display text at position(x,y)
where x is the row, and y is the column (or something similar).  I 
remember this capability in Ada83, but have been unable to find it in
Ada95.  

Thanks.

Joel





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

* Re: Displaying positional text
  1996-07-26  0:00 Displaying positional text 1Lt Joel Rudy
@ 1996-07-28  0:00 ` Robert Dewar
  1996-07-29  0:00 ` Do-While Jones
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Robert Dewar @ 1996-07-28  0:00 UTC (permalink / raw)



Joel asks

"Is there an Ada95 package that allows you to display text at position(x,y)
where x is the row, and y is the column (or something similar).  I
remember this capability in Ada83, but have been unable to find it in
Ada95."

There is no such feature in either Ada 83 or Ada 95, since obviously this
is highly implementation dependent (for example, what are x and y? 
character addresses -- well that assumes a simple display model with a
monospaced font -- pixel addresses? logical addresses?)

A typical implementation of Ada 95 will provide features for this kind
of access if they are appropriate to the system. See for example the
packages provided with the DOS version of GNAT.





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

* Re: Displaying positional text
  1996-07-26  0:00 Displaying positional text 1Lt Joel Rudy
  1996-07-28  0:00 ` Robert Dewar
@ 1996-07-29  0:00 ` Do-While Jones
  1996-07-30  0:00 ` Jerry van Dijk
  1996-07-31  0:00 ` Michael Feldman
  3 siblings, 0 replies; 5+ messages in thread
From: Do-While Jones @ 1996-07-29  0:00 UTC (permalink / raw)



In article <4taun9$3i2@hq.hq.af.mil> joel.rudy@comm.hq.af.mil (1Lt Joel Rudy) writes:
>Is there an Ada95 package that allows you to display text at position(x,y)
>where x is the row, and y is the column (or something similar).  I 
>remember this capability in Ada83, but have been unable to find it in
>Ada95.  
>
>Thanks.
>
>Joel
>

As has already been pointed out, Ada 83 did not really have this
capability.  However, there was (and still is) the VIRTUAL_TERMINAL package
that does.  I haven't ported it to Ada 95 myself, but it should not be
difficult.  It may even run without modification.  You can get it using
anonymous ftp from the Lower Panamint Valley server at Ridgecrest,
California.  FTP to

lo-pan.ridgecrest.ca.us

You will find it in 

pub/users/d/do_while/components/ada_in_action

Download all the files that begin with "aa10" because the VIRTUAL_TERMINAL
package is Ada in Action part 10.  VIRTUAL_TERMINAL depends upon
JONES_CONTROL_CODES, part number AA24, so you will have to download all
files beginning with "aa24" as well. 

[For those of you have downloaded some of my components before, you will
notice two differences in the location.  The Owens Valley server,
owens.ridgecrest.ca.us, has a brand new, improved operating system that
doesn't support anonymous ftp!  This capability will be restored soon, I'm
told, but for now you have to use lo-pan instead of owens.  Notice
there is now a "/d/" in the path.  The user directory got too large, and
had to be segmented.]

You are invited to snoop around and take anything you want from my public 
directory.

Do-While Joens

            +--------------------------------+
            |    Know                 Ada    |
            |        [Ada's Portrait]        |
            |    Will              Travel    |
            | wire do_while@ridgecrest.ca.us |
            +--------------------------------+


-- 
            +--------------------------------+
            |    Know                 Ada    |
            |        [Ada's Portrait]        |
            |    Will              Travel    |
            | wire do_while@ridgecrest.ca.us |
            +--------------------------------+




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

* Re: Displaying positional text
  1996-07-26  0:00 Displaying positional text 1Lt Joel Rudy
  1996-07-28  0:00 ` Robert Dewar
  1996-07-29  0:00 ` Do-While Jones
@ 1996-07-30  0:00 ` Jerry van Dijk
  1996-07-31  0:00 ` Michael Feldman
  3 siblings, 0 replies; 5+ messages in thread
From: Jerry van Dijk @ 1996-07-30  0:00 UTC (permalink / raw)



1Lt Joel Rudy (joel.rudy@comm.hq.af.mil) wrote:

: Is there an Ada95 package that allows you to display text at position(x,y)
: where x is the row, and y is the column (or something similar).

Not in Ada itself, since it would depend on the platform the program
is running on.

However, there probably is a function to do this somewhere on your system,
just import & and use it.

If you happen to use GNAT on DOS you might use:

	procedure Goto_XY (X, Y : in Integer);
	pragma Import (C, Goto_XY, "gotoxy");

and move the cursor home with:

	Goto_XY (1, 1);

Hope this helps,
Jerry.

-- 
-----------------------------------------------------------------------
--  Jerry van Dijk       --   e-mail: jerry@jvdsys.nextjk.stuyts.nl  --
--  Banking Consultant   --              Member Team-Ada             -- 
--  Ordina Finance BV    --    Located at Haarlem, The Netherlands   --




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

* Re: Displaying positional text
  1996-07-26  0:00 Displaying positional text 1Lt Joel Rudy
                   ` (2 preceding siblings ...)
  1996-07-30  0:00 ` Jerry van Dijk
@ 1996-07-31  0:00 ` Michael Feldman
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Feldman @ 1996-07-31  0:00 UTC (permalink / raw)



In article <4taun9$3i2@hq.hq.af.mil>,
1Lt Joel Rudy <joel.rudy@comm.hq.af.mil> wrote:
>Is there an Ada95 package that allows you to display text at position(x,y)
>where x is the row, and y is the column (or something similar).  I 
>remember this capability in Ada83, but have been unable to find it in
>Ada95.  
>
>Thanks.
>
>Joel
>
Here's simple version. Ada 83 had no standard way to do this, nor
does Ada 95, but if you have an ANSI-compatible 24x80 screen, this
will serve as a starting point. GNAT would call these screen.ad[sb].

Mike Feldman


PACKAGE Screen IS
------------------------------------------------------------------
--| Procedures for drawing pictures on ANSI Terminal Screen
--| Author: Michael B. Feldman, The George Washington University 
--| Last Modified: October 1995                                     
------------------------------------------------------------------

  ScreenHeight : CONSTANT Integer := 24;
  ScreenWidth : CONSTANT Integer := 80;

  SUBTYPE Height IS Integer RANGE 1..ScreenHeight;
  SUBTYPE Width  IS Integer RANGE 1..ScreenWidth;

  TYPE Position IS RECORD
    Row   : Height := 1;
    Column: Width := 1;
  END RECORD;

  PROCEDURE Beep; 
  -- Pre:  none
  -- Post: the terminal beeps once
  
  PROCEDURE ClearScreen; 
  -- Pre:  none
  -- Post: the terminal screen is cleared
  
  PROCEDURE MoveCursor (To: IN Position);
  -- Pre:  To is defined
  -- Post: the terminal cursor is moved to the given position
  
END Screen;   


WITH Ada.Text_IO;
WITH Ada.Integer_Text_IO;
PACKAGE BODY Screen IS
------------------------------------------------------------------
--| Procedures for drawing pictures on ANSI Terminal Screen
--| These procedures will work correctly only if the actual
--| terminal is ANSI compatible. ANSI.SYS on a DOS machine
--| will suffice.
--| Author: Michael B. Feldman, The George Washington University 
--| Last Modified: September 1995                                     
------------------------------------------------------------------

  PROCEDURE Beep IS
  BEGIN
    Ada.Text_IO.Flush;
    Ada.Text_IO.Put (Item => ASCII.BEL);
  END Beep;

  PROCEDURE ClearScreen IS
  BEGIN
    Ada.Text_IO.Put (Item => ASCII.ESC);
    Ada.Text_IO.Put (Item => "[2J");
    Ada.Text_IO.Flush;
  END ClearScreen;

  PROCEDURE MoveCursor (To: IN Position) IS
  BEGIN                                                
    Ada.Text_IO.Flush;
    Ada.Text_IO.Put (Item => ASCII.ESC);
    Ada.Text_IO.Put ("[");
    Ada.Integer_Text_IO.Put (Item => To.Row, Width => 1);
    Ada.Text_IO.Put (Item => ';');
    Ada.Integer_Text_IO.Put (Item => To.Column, Width => 1);
    Ada.Text_IO.Put (Item => 'f');
  END MoveCursor;  

END Screen;




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

end of thread, other threads:[~1996-07-31  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-26  0:00 Displaying positional text 1Lt Joel Rudy
1996-07-28  0:00 ` Robert Dewar
1996-07-29  0:00 ` Do-While Jones
1996-07-30  0:00 ` Jerry van Dijk
1996-07-31  0:00 ` Michael Feldman

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