comp.lang.ada
 help / color / mirror / Atom feed
* Need a gotoXY consol IO procedure for Rational Apex on Sun
@ 2003-03-12 21:01 �rjan Leringe
  2003-03-13  1:12 ` Jeffrey Creem
  2003-03-15  1:41 ` Jeffrey Carter
  0 siblings, 2 replies; 4+ messages in thread
From: �rjan Leringe @ 2003-03-12 21:01 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 282 bytes --]

I need a procedure to do a little more than text_IO on Rational Apex for
Sun. Actually the only procedure need is

    procedure Goto_XY (X, Y: Integer);

which positions the cursor to pos X and row Y (Y can be backwards current
position).

How do I do this?

�rjan Leringe







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

* Re: Need a gotoXY consol IO procedure for Rational Apex on Sun
  2003-03-12 21:01 Need a gotoXY consol IO procedure for Rational Apex on Sun �rjan Leringe
@ 2003-03-13  1:12 ` Jeffrey Creem
  2003-03-13 18:25   ` Warren W. Gay VE3WWG
  2003-03-15  1:41 ` Jeffrey Carter
  1 sibling, 1 reply; 4+ messages in thread
From: Jeffrey Creem @ 2003-03-13  1:12 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 783 bytes --]

"�rjan Leringe" <ol@mariadata.se> wrote in message
news:VeNba.75$Du.631@newsc.telia.net...
> I need a procedure to do a little more than text_IO on Rational Apex for
> Sun. Actually the only procedure need is
>
>     procedure Goto_XY (X, Y: Integer);
>
> which positions the cursor to pos X and row Y (Y can be backwards current
> position).
>


You probably want to use something like ncurses

http://www.familiepfeifer.de/juergen/ncurses.html

I think you can get ncurses (a GNU package ftp.gnu.org) to compile under
Solaris.
The Ada binding above was done to work with GNAT but perhaps it will work
with Apex.

Also poke around in the rational/base directory and make sure there is not
already some curses binding there.. I can't remember offhand if there
already was one.





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

* Re: Need a gotoXY consol IO procedure for Rational Apex on Sun
  2003-03-13  1:12 ` Jeffrey Creem
@ 2003-03-13 18:25   ` Warren W. Gay VE3WWG
  0 siblings, 0 replies; 4+ messages in thread
From: Warren W. Gay VE3WWG @ 2003-03-13 18:25 UTC (permalink / raw)


Jeffrey Creem wrote:
> "�rjan Leringe" <ol@mariadata.se> wrote in message
> news:VeNba.75$Du.631@newsc.telia.net...
> 
>>I need a procedure to do a little more than text_IO on Rational Apex for
>>Sun. Actually the only procedure need is
>>
>>    procedure Goto_XY (X, Y: Integer);
>>
>>which positions the cursor to pos X and row Y (Y can be backwards current
>>position).
> 
> You probably want to use something like ncurses
> 
> http://www.familiepfeifer.de/juergen/ncurses.html

If you are absolutely sure that you only need cursor positioning,
and perhaps one or two other simple functions (like clear screen),
you could get by with curs_termcap(3X) routines, of which you can
build a binding to.

A "man curs_termcap" turns up:

NAME
        tgetent,  tgetflag,  tgetnum,  tgetstr,  tgoto,  tputs  ? direct curses
        interface to the terminfo capability database

SYNOPSIS
        #include <curses.h>
        #include <term.h>
        extern char PC; extern char * UP; extern char * BC; extern unsigned int
        ospeed;
        int tgetent(char *bp, const char *name);
        int tgetflag(char *id);
        int tgetnum(char *id);
        char *tgetstr(char *id, char **area);
        char *tgoto(const char *cap, int col, int row);
        int tputs(const char *str, int affcnt, int (*putc)(int));

The tricky part about some terminal escape sequences is however,
that you need to supply parameters (move cursor is an example).
If you also need to interpret function keys etc., you will
get into even more work, which is probably more than you want.

Without just using a few routines above to control the terminal
directly, you pretty much have to go "whole hog" into [n]curses,
and call initscr() and endwin() and everything else in between.
You can't just use move() from the ncurses library, for example.

If you are doing this for Windows, then PDCurses is available, or
ncurses works (I believe) in a CYGWIN environment.

-- 
Warren W. Gay VE3WWG
http://home.cogeco.ca/~ve3wwg




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

* Re: Need a gotoXY consol IO procedure for Rational Apex on Sun
  2003-03-12 21:01 Need a gotoXY consol IO procedure for Rational Apex on Sun �rjan Leringe
  2003-03-13  1:12 ` Jeffrey Creem
@ 2003-03-15  1:41 ` Jeffrey Carter
  1 sibling, 0 replies; 4+ messages in thread
From: Jeffrey Carter @ 2003-03-15  1:41 UTC (permalink / raw)


�rjan Leringe wrote:
 > I need a procedure to do a little more than text_IO on Rational Apex
 > for Sun. Actually the only procedure need is
 >
 > procedure Goto_XY (X, Y: Integer);
 >
 > which positions the cursor to pos X and row Y (Y can be backwards
 > current position).

If you're doing this for Sun then you can probably use ANSI escape 
sequences. See, for example, PragmARC.ANSI_TTY_Control from the PragmAda 
Reusable Components

http://home.earthlink.net/~jrcarter010/pragmarc.htm

-- 
Jeff Carter
"That was the most fun I've ever had without laughing."
Annie Hall




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

end of thread, other threads:[~2003-03-15  1:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-12 21:01 Need a gotoXY consol IO procedure for Rational Apex on Sun �rjan Leringe
2003-03-13  1:12 ` Jeffrey Creem
2003-03-13 18:25   ` Warren W. Gay VE3WWG
2003-03-15  1:41 ` Jeffrey Carter

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