comp.lang.ada
 help / color / mirror / Atom feed
* Re: clearing a screen in ada? (new to ada)
  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
  0 siblings, 1 reply; 13+ messages in thread
From: Larry Kilgallen @ 2000-03-04  0:00 UTC (permalink / raw)


In article <38c1621e$0$19330@motown.iinet.net.au>, "Nigel" <darkwind@wantree.com.au> writes:

>                     I have just started learning ada, and I was wondering
> what package and command I use for clearing the screen, sort of like a CLS
> command?

This sort of thing tends to be operating system specific.

If you are on VMS using either DEC Ada or GNAT you can
call procedure ERASE_DISPLAY in the SMG package (after
suitable setup).




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

* clearing a screen in ada? (new to ada)
@ 2000-03-05  0:00 Nigel
  2000-03-04  0:00 ` Larry Kilgallen
  0 siblings, 1 reply; 13+ messages in thread
From: Nigel @ 2000-03-05  0:00 UTC (permalink / raw)


G'day guys,
                    I have just started learning ada, and I was wondering
what package and command I use for clearing the screen, sort of like a CLS
command?
Thanks for your help in advance
Nigel






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

* Re: clearing a screen in ada? (new to ada)
  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     ` Marin D. Condic
  1 sibling, 2 replies; 13+ messages in thread
From: tmoran @ 2000-03-06  0:00 UTC (permalink / raw)


>comand like CLS to clear the screen and also the LOCATE type commands for
  If you are running ANSI.SYS, you can use Mike Feldman's package.
Look at www.adapower.com   If you don't find it directly, I'm sure
it's present in his "Dining Philosophers" example.

>not being able to move the cursor back up the screen when I have
>drawn the box is making this hell
  If you can't/don't use ANSI.SYS, but are doing strictly output,
how about writing into an array (1 .. 24, 1 .. 80) of Character,
putting whatever, wherever, and then finally writing all its
lines to the screen.




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

* Re: clearing a screen in ada? (new to ada)
  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         ` Alfred Hilscher
                           ` (2 more replies)
  1 sibling, 3 replies; 13+ messages in thread
From: Riyaz Mansoor @ 2000-03-07  0:00 UTC (permalink / raw)



> >not being able to move the cursor back up the screen when I have
> >drawn the box is making this hell
>   If you can't/don't use ANSI.SYS, but are doing strictly output,
> how about writing into an array (1 .. 24, 1 .. 80) of Character,
> putting whatever, wherever, and then finally writing all its
> lines to the screen.

but wouldn't this put the cursor at the start of the next screen? more
precisely we'd lose the top line as it scrolls down. is there just no way
that ADA can place cursor's on non ANSI standard desktops?






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

* Re: clearing a screen in ada? (new to ada)
  2000-03-06  0:00     ` tmoran
@ 2000-03-07  0:00       ` Ehud Lamm
  2000-03-07  0:00       ` Riyaz Mansoor
  1 sibling, 0 replies; 13+ messages in thread
From: Ehud Lamm @ 2000-03-07  0:00 UTC (permalink / raw)


What might be useful is a package specification providing only the most
basic and often requested operatons, along with implementations for
various platofrms. Something like GNAT.OS* packages.

Ehud Lamm mslamm@mscc.huji.ac.il
http://purl.oclc.org/NET/ehudlamm <== My home on the web 
Check it out and subscribe to the E-List- for interesting essays and more!






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

* Re: clearing a screen in ada? (new to ada)
  2000-03-07  0:00         ` tmoran
@ 2000-03-07  0:00           ` Jerry van Dijk
  0 siblings, 0 replies; 13+ messages in thread
From: Jerry van Dijk @ 2000-03-07  0:00 UTC (permalink / raw)


> >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
>   I think Mike Feldman's "screen" package is normally automatically

On my homepage there is both an NT version of Mike Feldman's screen package,
as a more extensive NT_Console package.

Jerry.


--
--  Jerry van Dijk  | email: jdijk@acm.org
--  Team-Ada        | web:   stad.dsl.nl/~jvandyk
--  Paris, France   | Leiden, Holland







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

* Re: clearing a screen in ada? (new to ada)
  2000-03-04  0:00 ` Larry Kilgallen
@ 2000-03-07  0:00   ` Nigel
  2000-03-06  0:00     ` tmoran
  2000-03-07  0:00     ` Marin D. Condic
  0 siblings, 2 replies; 13+ messages in thread
From: Nigel @ 2000-03-07  0:00 UTC (permalink / raw)


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)
Nigel







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

* Re: clearing a screen in ada? (new to ada)
  2000-03-07  0:00       ` Riyaz Mansoor
  2000-03-07  0:00         ` Alfred Hilscher
  2000-03-07  0:00         ` Marin D. Condic
@ 2000-03-07  0:00         ` tmoran
  2000-03-07  0:00           ` Jerry van Dijk
  2 siblings, 1 reply; 13+ messages in thread
From: tmoran @ 2000-03-07  0:00 UTC (permalink / raw)


>is there just no way that ADA can place cursor's on non ANSI standard desktops?
  In some cases the answer may be yes.  Your typical missile, for
instance, has no "ANSI standard desktops", and indeed even an Ada
program cannot place a cursor on a non-existent screen.

  However, the original question was rather specific:

>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
  I think Mike Feldman's "screen" package is normally automatically
installed in the act\gnat\examples directory.  If the lack of ANSI
screen control prevents its use, and using anything from outside
the GNAT installation is really disallowed, then either OS calls
or hardware IO are obviously required, both of which can be done
with GNAT.  As I recall, Cohen's book "Ada as a second language"
has an example of direct screen access on a PC.




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

* Re: clearing a screen in ada? (new to ada)
  2000-03-07  0:00       ` Riyaz Mansoor
@ 2000-03-07  0:00         ` Alfred Hilscher
  2000-03-07  0:00         ` Marin D. Condic
  2000-03-07  0:00         ` tmoran
  2 siblings, 0 replies; 13+ messages in thread
From: Alfred Hilscher @ 2000-03-07  0:00 UTC (permalink / raw)


Another solution: Ok, it not a good way, but what do you think about
directly writing in screen memory (WinNT emulates it at B800:0) ? But
you would have to write your own screen handling from scratch.

Riyaz Mansoor wrote:
> 
> > >not being able to move the cursor back up the screen when I have
> > >drawn the box is making this hell
> >   If you can't/don't use ANSI.SYS, but are doing strictly output,
> > how about writing into an array (1 .. 24, 1 .. 80) of Character,
> > putting whatever, wherever, and then finally writing all its
> > lines to the screen.
> 
> but wouldn't this put the cursor at the start of the next screen? more
> precisely we'd lose the top line as it scrolls down. is there just no way
> that ADA can place cursor's on non ANSI standard desktops?




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

* Re: clearing a screen in ada? (new to ada)
  2000-03-07  0:00     ` Marin D. Condic
@ 2000-03-07  0:00       ` Ade Vickers
  2000-03-08  0:00         ` Riyaz Mansoor
  0 siblings, 1 reply; 13+ messages in thread
From: Ade Vickers @ 2000-03-07  0:00 UTC (permalink / raw)


"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.




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

* Re: clearing a screen in ada? (new to ada)
  2000-03-07  0:00   ` Nigel
  2000-03-06  0:00     ` tmoran
@ 2000-03-07  0:00     ` Marin D. Condic
  2000-03-07  0:00       ` Ade Vickers
  1 sibling, 1 reply; 13+ messages in thread
From: Marin D. Condic @ 2000-03-07  0:00 UTC (permalink / raw)


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. 

Anybody remember off the top of their head what the escape codes are for
those functions?

MDC
-- 
=============================================================
Marin David Condic   - Quadrus Corporation -   1.800.555.3393
1015-116 Atlantic Boulevard, Atlantic Beach, FL 32233
http://www.quadruscorp.com/
m c o n d i c @ q u a d r u s c o r p . c o m

***PLEASE REMOVE THE "-NOSPAM" PART OF MY RETURN ADDRESS***

Visit my web site at:  http://www.mcondic.com/

"Because that's where they keep the money."
    --  Willie Sutton when asked why he robbed banks. 
=============================================================




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

* Re: clearing a screen in ada? (new to ada)
  2000-03-07  0:00       ` Riyaz Mansoor
  2000-03-07  0:00         ` Alfred Hilscher
@ 2000-03-07  0:00         ` Marin D. Condic
  2000-03-07  0:00         ` tmoran
  2 siblings, 0 replies; 13+ messages in thread
From: Marin D. Condic @ 2000-03-07  0:00 UTC (permalink / raw)


Riyaz Mansoor wrote:
> but wouldn't this put the cursor at the start of the next screen? more
> precisely we'd lose the top line as it scrolls down. is there just no way
> that ADA can place cursor's on non ANSI standard desktops?

There is *always* a way to do whatever you want with Ada. Its a language
like any other language and can be made to produce every possible
permutation of bits that can be held in a processor's instruction
memory.

The problem you are looking at here is really an OS or Peripherial
problem, not an Ada problem. The questipon is: What terminal or terminal
emulator are you using and what commands must it be sent to make it do
the things you want to do?

I'll bet if you find some documentation on the terminal emulation you
are using that somewhere it specifies what character combinations you
have to send it to get it to perform various functions. Once you know
what those are, the problem is pretty simple. You just need to send
those character combinations the same way you'd send any other
characters: rely on Text_IO.

If you can't find documentation for the terminal emulator, ask here
again and specify exactly what you are using and I'm sure someone will
know.

MDC
-- 
=============================================================
Marin David Condic   - Quadrus Corporation -   1.800.555.3393
1015-116 Atlantic Boulevard, Atlantic Beach, FL 32233
http://www.quadruscorp.com/
m c o n d i c @ q u a d r u s c o r p . c o m

***PLEASE REMOVE THE "-NOSPAM" PART OF MY RETURN ADDRESS***

Visit my web site at:  http://www.mcondic.com/

"Because that's where they keep the money."
    --  Willie Sutton when asked why he robbed banks. 
=============================================================




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

* Re: clearing a screen in ada? (new to ada)
  2000-03-07  0:00       ` Ade Vickers
@ 2000-03-08  0:00         ` Riyaz Mansoor
  0 siblings, 0 replies; 13+ messages in thread
From: Riyaz Mansoor @ 2000-03-08  0:00 UTC (permalink / raw)


> 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...

this will work if "ansi.sys" is loaded into the config.sys file or its
repective one on NT. any ideas on finding these escape keys for win95 or
win98? as u know their "config.sys" file, by default is empty. this begs
another question. how does one go about finding what's controling one's
termial? for ex: if "ansi.sys" is loaded then i know it is. but if its not?

thanx for all the help






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

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

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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         ` Alfred Hilscher
2000-03-07  0:00         ` Marin D. Condic
2000-03-07  0:00         ` tmoran
2000-03-07  0:00           ` Jerry van Dijk
2000-03-07  0:00     ` Marin D. Condic
2000-03-07  0:00       ` Ade Vickers
2000-03-08  0:00         ` Riyaz Mansoor

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