From: Ade Vickers <nospam@ttoolsbase.com>
Subject: Re: clearing a screen in ada? (new to ada)
Date: 2000/03/07
Date: 2000-03-07T00:00:00+00:00 [thread overview]
Message-ID: <38C5090D.2C5C9D33@ttoolsbase.com> (raw)
In-Reply-To: 38C53105.CBD5B94A@quadruscorp.com
"Marin D. Condic" wrote:
>
> Nigel wrote:
> >
> > ahhh sorry I am using GNAT on a PC using the ADAGIDE, we basically are only
> > allowed to use the standard libs/packages that come with gnat, and I was
> > hoping to find infor for moving the cursor round the screen such as using a
> > comand like CLS to clear the screen and also the LOCATE type commands for
> > postioning the cursor, I have tried using set_col and set_line in the
> > Text_IO package, but it only works in a positive manner and so I can't go
> > back up the screen. basically I am righting a box prog to make my input
> > screens look a little more interesting, and not being able to move the
> > cursor back up the screen when I have drawn the box is making this hell
> > thanks once again for help :o)
>
> You could "roll your own" screen control code. All you have to do is
> send the proper escape sequences to the terminal and you can get it to
> clear the screen, position the cursor, etc. You can send the escape
> sequences using Ada.Text_IO facilities, so there isn't anything
> non-standard about it. You can probably get by if you build a small
> package with two procedures: Clear_Screen and Goto_XY. Just get the
> escape sequences for those two features and wrap a little code around
> the Goto_XY one to convert its parameters to proper screen coordinates.
The distribution of GNAT I downloaded the other day contains (in the
Examples directory) a file to do just this: screen.ads/.adb.
> Anybody remember off the top of their head what the escape codes are for
> those functions?
ESC[2J - clear screen
ESC[yy;xxf - move to row yy, col xx
That's contained within screen.adb; my memory would never have stretched
to remembering those...
--
Cheers,
Ade.
If at first you fail, cheat. Repeat until caught, then lie.
next prev parent reply other threads:[~2000-03-07 0:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-03-05 0:00 clearing a screen in ada? (new to ada) Nigel
2000-03-04 0:00 ` Larry Kilgallen
2000-03-07 0:00 ` Nigel
2000-03-06 0:00 ` tmoran
2000-03-07 0:00 ` Ehud Lamm
2000-03-07 0:00 ` Riyaz Mansoor
2000-03-07 0:00 ` tmoran
2000-03-07 0:00 ` Jerry van Dijk
2000-03-07 0:00 ` Alfred Hilscher
2000-03-07 0:00 ` Marin D. Condic
2000-03-07 0:00 ` Marin D. Condic
2000-03-07 0:00 ` Ade Vickers [this message]
2000-03-08 0:00 ` Riyaz Mansoor
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox