I've found a pervasive problem---I'm obsolete.  I recall having written or modified termcap entries.  And I wrote a character cell/vi-keyboard motion version of WINMINES that automatically played all trivially counted zones.  Following a few visually pleasing update waves, holes to be solved by thought or guess remained.  The macros in dwlmines.c expanded into lines exceeding the maximum line length of the Microsoft compiler at the time. With gcc, no problem of course.  Yes, I test these j sample programs in xterm.  Otherwise, I claim only to have once upon a time known something.

TERMCAP(5)              Linux Programmer's Manual TERMCAP(5)
NAME         top
       termcap - terminal capability database
DESCRIPTION         top
       The termcap database is an obsolete facility


|Date: Sat, 12 Jun 2021 07:15:40 -0400
|From: Raul Miller <[email protected]>
|To: Programming forum <[email protected]>
|Subject: Re: [Jprogramming] ncurses
|Message-ID:
| <CAD2jOU9TROf9NXa5F2=6ZdStdB=_bvmbqecaxptrcv0dtm1...@mail.gmail.com>
|Content-Type: text/plain; charset="UTF-8"
|
|nl_ncurses_ is a call to the nl routine in the ncurses library. But
|names_z_ expects a different definition of nl in the locale where it
|is used. You might try this:

completely new to me, I haven't a clue why this is so.

|   nms_z_=:4!:1
|   names_z_ nms_ncurses_ i.4
|A_ALTCHARSET       A_ATTRIBUTES       A_BLINK
|A_BOLD             A_CHARTEXT         A_COLOR
|...
|
|Also, note that ncurses should only be expected to function usefully
|in jconsole, since it expects a terminal window (though it might be
|handy to have a jqt or jhs session with ncurses loaded so that you can
|inspect its definitions more easily). You presumably would also want
|to make sure that the TERM environmental variable is set properly
|before starting that jconsole session.
|
|Note that you should also install ncurses-doc using apt so that you  --- used thanks
|could, for example, look at the man page for nl. (Use man 3 nl if you
|also have a man page for the command line program named nl which
|prepends line numbers).
|
|That said, I was not able to get the ncurses api to work on my system.

Other features worked to the extent I needed to recall stty sane command.

|
|I defined a relatively simple example program:
|
|load'~addons/api/ncurses/ncurses.ijs'
|coinsert'ncurses'
|
|example=:3 :0
|  stdscr=: initscr''
|  move 3 10             NB. no luck.
|  addch"0 'Hello World!'

refresh''   NB. with refresh clear succeeded.

|  getch''
|  endwin stdscr
|)
|
|But I don't have a system handy with ncurses on it, so I can't test
|it. I hope that's close enough to correct that you can find and fix
|any bugs...
|
|Note that I used addch"0 because there's no printw in the current j
|ncurses api implementation. I think it should be straightforward to
|define a wrapper verb (which analyzed its arguments, built an
|appropriate library reference string and called 15!:0 directly). But,
|I would want to be able to test what I was building to make sure I had
|gotten the details right.
|
|I hope this helps. (I don't know how much you do or do not already
|know about ncurses...)
|
|--
|Raul

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to