comp.lang.ada
 help / color / mirror / Atom feed
From: brashear@ajpo.sei.cmu.edu (Philip Brashear)
Subject: Re: GOTOXY in Ada ?
Date: Thu, 8 Dec 1994 08:04:23 EST
Date: 1994-12-08T08:04:23-05:00	[thread overview]
Message-ID: <1994Dec8.080423.3368@sei.cmu.edu> (raw)
In-Reply-To: 3c4a9a$1lts@obelix.uni-muenster.de

In article <3c4a9a$1lts@obelix.uni-muenster.de> ahlersj@comix.uni-muenster.de (Jan Ahlers) writes:
>
>Is there an equivalent in Ada to the gotoxy command in Pascal (-> put the
>cursor at column x, row y) ? Answers would be greatly appreciated !
>

Jan, let me point out that Pascal has no such command either.  The particular
Pascal implementation (compiler/environment/libraries) that you are using is
kind enough to supply you with cursor movement operations.  You must realize
that such things are completely dependent on the kind of display device you
are using.  Since Pascal is intended to be portable, the language definition
doesn't specify such things.

That being said, it should be obvious that Ada doesn't specify cursor control
either.  However, it's simple enough to write your own, provided that you can
track down the appropriate "escape sequences" that make your terminal do what
you want.  Just do text_io "put" to the screen, sending a string like

       ASCII.ESC & "[6;14H"

If you're using an ANSI standard terminal, will send the cursor to line 6,
column 14.

DISCLAIMER:  I didn't try this precisely -- I depended on memory and an out-
of-date reference manual for a particular terminal.  Nevertheless, the idea
works.  I've used it several times.

Good hunting!

Phil Brashear
CTA INCORPORATED





  reply	other threads:[~1994-12-08 13:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-12-07 12:36 GOTOXY in Ada ? Jan Ahlers
1994-12-08 13:04 ` Philip Brashear [this message]
1994-12-09  4:19   ` Dave Retherford
1994-12-12  8:45     ` Keith Thompson
1994-12-13 10:09     ` Andre Spiegel
1994-12-09  2:59 ` Michael Feldman
1994-12-09 15:22 ` Do-While Jones
1994-12-10 21:00   ` Michael Feldman
  -- strict thread matches above, loose matches on Subject: below --
1994-12-20  2:06 GOTOXY IN ADA ? Michael Hagerty
replies disabled

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