Dear Gaius
In the meantime I found out how to link the program with the ncurses
library.
The following statement did the compilation and linking:
*gm2 -g -I.
-I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim
-I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/log
-I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/min-L.
-l:libncurses.so.5 -flibs=pim,log -fmakeall ./clear_screen_m2.mod*
I made a piece of test code (clear_screen_m2.mod):
*MODULE clear_screen_m2;
FROM ncurses IMPORT clear;
FROM InOut IMPORT WriteString;WriteLn;
VAR retVal:INTEGER;
BEGIN
  WriteString(" Before clear screen ");WriteLn;
  retVal := clear ();
  WriteString(" After clear screen ");WriteLn;
END clear_screen_m2.*
I get an "./a.out" which I can execute, though the screen is not cleared.
*slotboom@JS-at-Asus:~/development/DEF_SIMU$ ./a.out
 Before clear screen  After clear screen*
*slotboom@JS-at-Asus:~/development/DEF_SIMU$*
So although the function clear() is called the bash shell is not cleared.
Do you know what I still do wrong?
Have a nice day,
Hans
On Sun, Jan 5, 2020 at 9:15 PM <address@hidden
<mailto:address@hidden>> wrote:
Send gm2 mailing list submissions to
    address@hidden <mailto:address@hidden>
To subscribe or unsubscribe via the World Wide Web, visit
    https://lists.nongnu.org/mailman/listinfo/gm2
or, via email, send a message with subject or body 'help' to
    address@hidden <mailto:address@hidden>
You can reach the person managing the list at
    address@hidden <mailto:address@hidden>
When replying, please edit your Subject line so it is more specific
than "Re: Contents of gm2 digest..."
Today's Topics:
  1. Re: gm2 Digest, Vol 157, Issue 2 (Johannes Slotboom)
  2. Libncurses [Was: Re: gm2 Digest, Vol 157, Issue 2] (john
o goyo)
----------------------------------------------------------------------
Message: 1
Date: Sun, 5 Jan 2020 19:17:45 +0100
From: Johannes Slotboom <address@hidden
<mailto:address@hidden>>
To: address@hidden <mailto:address@hidden>
Subject: Re: gm2 Digest, Vol 157, Issue 2
Message-ID:
   Â
<CAAcvka=jxi6N9uOesg2XJ_fkH-k-FnZJFq7K=+address@hidden
<mailto:address@hidden>>
Content-Type: text/plain; charset="utf-8"
Dear Gaius
Sorry for another mail from me about the usage of the ncurses.def
to enable
"clear()" of the working terminal.
I copied the ncurses.def file into the directory where I do the
compilation. I imported the clear functionality from it.
Than my Modula-2 file nicely compiles, but it does not link:
gm2 -g -I.
-I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim
-I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/log
-I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/min
-flibs=pim,log -fmakeall ./SpinSimMain.mod
make: Nothing to be done for 'SpinSimMain'.
/tmp/ccDs7BDg.a(SpinSimMain.o): In function `Define_Batch':
/home/slotboom/development/DEF_SIMU/./SpinSimMain.mod:1531: undefined
reference to `clear'
collect2: error: ld returned 1 exit status
I have:
 *libncurses.so.5*
and a
 *libncursesw.so.5*
in the /lib/x86_64-linux-gnu directory and the .bashrc
*LD_LIBRARY_PATH*
includes this directory.
One questions I have therefore:
- are these the libraries I need to link the application to get the
"clear()" function working, or do I need another ncurses library
to be
installed?
Have a nice evening,
Hans
P.S. I have in the meantime got another MODULA-2 application
working (apart
from the clear() function) and am very happy with it!
On Fri, Jan 3, 2020 at 6:04 PM <address@hidden
<mailto:address@hidden>> wrote:
> Send gm2 mailing list submissions to
>Â Â Â Â Â address@hidden <mailto:address@hidden>
>
> To subscribe or unsubscribe via the World Wide Web, visit
>Â Â Â Â Â https://lists.nongnu.org/mailman/listinfo/gm2
> or, via email, send a message with subject or body 'help' to
>Â Â Â Â Â address@hidden <mailto:address@hidden>
>
> You can reach the person managing the list at
>Â Â Â Â Â address@hidden <mailto:address@hidden>
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of gm2 digest..."
>
>
> Today's Topics:
>
>Â Â 1. Re: Using pim/log/ulm together and clearing terminal
>Â Â Â Â (Gaius Mulley)
>
>
>
----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 03 Jan 2020 13:42:09 +0000
> From: Gaius Mulley <address@hidden
<mailto:address@hidden>>
> To: Johannes Slotboom <address@hidden
<mailto:address@hidden>>
> Cc: address@hidden <mailto:address@hidden>
> Subject: Re: Using pim/log/ulm together and clearing terminal
> Message-ID: <address@hidden
<mailto:address@hidden>>
> Content-Type: text/plain
>
> Johannes Slotboom <address@hidden
<mailto:address@hidden>> writes:
>
> > Dear Gaius,
> >
> > I have my old Logitech Modula-2 program compiling again, and
I am very
> > happy about that!!!
> >
> > Since my program is a late 80tees beginning 90tees style
where the
> > user interactively selects from presented text menus in the
console
> > (newly bash-shell) I am in need for an equivalent for the
Logitech
> > Modula-2 "Screenmode(3)" functionalityt which cleared the
DOS-screen
> > and printed the new menu from the top of the screen again.
> >
> > I tried to simulate this behaviour by writing character 33:
> >
> > Write( CHR(33) );
> >
> > ( CHR(33) should be the erase shell character.)
> >
> > however this unfortunately does not work. Than I saw that in
the Ulm
> > library there is a module called "CallShell" in which I plan
to call
> > "clear" which would do the trick (I hope at least).
> > VAR status: CARDINAL;
> > BOOLEAN response := PROCEDURE Shell( "clear", status );
>
> Hi Hans,
>
> yes the special character codes are not interpreted (yet) in
> Display/Terminal. This could be added though. At present
there is a
> substitute - which is to use the ncurses.def found in the examples:
>
>
>
http://git.savannah.gnu.org/cgit/gm2.git/tree/gcc-versionno/gcc/m2/examples/ncurses/ncurses.def
>
> there are a few tiny example programs in the same directory.
>
> > however if I try the latter there seem to be a problem with
using the
> > pim and ulm libraries. Namely trying to build my application
with:
> >
> > gm2 -g -I. -
> > I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim -
> > I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/log -
> > I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/min -
> > I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/ulm -
> > flibs=pim,log,ulm -fmakeall ./ilv.mod
> >
> > results in the following terminal output:
> >
> > gm2 -c -fmakeall0 -
> > B/home/slotboom/opt/lib/gcc//x86_64-pc-linux-gnu/8.2.0 -g
-fonlylink -
> > fobject-path=. -
> >
fobject-path=/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim
> >
-fobject-path=/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/log
> >
-fobject-path=/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/min
> >
-fobject-path=/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/ulm
> > -ftarget-ar=/usr/bin/ar -ftarget-ranlib=/usr/bin/ranlib
-fplugin=m2rte
> > -flibs=pim,log,ulm -fmakeall -I. -
> > I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim -
> > I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/log -
> > I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/min -
> > I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/ulm -
> > I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim -
> > I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/log -
> > I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/ulm
-I -I .
> > /ilv.mod
> >
/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/ulm/libulm.a
> > (libulm_la-SYSTEM.o): In function `_M2_SYSTEM_init':
> >
>
/home/slotboom/build-8.2.0/x86_64-pc-linux-gnu/libgm2/libulm/SYSTEM.c:622:
> > multiple definition of `_M2_SYSTEM_init'
> >
/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim/libgm2.a
> >
>
(SYSTEM.o):/home/slotboom/build-8.2.0/x86_64-pc-linux-gnu/libgm2/libpim/SYSTEM.def:20:
> > first defined here
> >
/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/ulm/libulm.a
> > (libulm_la-SYSTEM.o): In function `_M2_SYSTEM_finish':
> >
>
/home/slotboom/build-8.2.0/x86_64-pc-linux-gnu/libgm2/libulm/SYSTEM.c:773:
> > multiple definition of `_M2_SYSTEM_finish'
> >
/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim/libgm2.a
> >
>
(SYSTEM.o):/home/slotboom/build-8.2.0/x86_64-pc-linux-gnu/libgm2/libpim/SYSTEM.def:20:
> > first defined here
> > collect2: error: ld returned 1 exit status
> >
> > So my additional question (apart from erasing the bash shell)
is the
> > question whether the ulm, log, pim and iso libraries cannot
be used
> > together in one application?
>
> it should be possible to use pim, iso and log in a single
application.
> The ulm is probably best to work with alone (or maybe with
pim). If you
> use coroutines then you have to decide on a particular paradigm
and not
> mix them :-). In conclusion they are designed to work
together but if
> the modules utilise aspects of SYSTEM.def/mod which contain
different
> declarations of the same named entity then problems arise,
>
> hope that helps,
>
> regards,
> Gaius
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> gm2 mailing list
> address@hidden <mailto:address@hidden>
> https://lists.nongnu.org/mailman/listinfo/gm2
>
>
> ------------------------------
>
> End of gm2 Digest, Vol 157, Issue 2
> ***********************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<https://lists.nongnu.org/archive/html/gm2/attachments/20200105/97259885/attachment.html>
------------------------------
Message: 2
Date: Sun, 5 Jan 2020 15:06:53 -0500
From: john o goyo <address@hidden
<mailto:address@hidden>>
To: address@hidden <mailto:address@hidden>
Subject: Libncurses [Was: Re: gm2 Digest, Vol 157, Issue 2]
Message-ID:
<address@hidden
<mailto:address@hidden>>
Content-Type: text/plain; charset=windows-1252; format=flowed
Greetings, Johannes.
On 01/05/20 13:17, Johannes Slotboom wrote:
> Dear Gaius
>
> Sorry for another mail from me about the usage of the
ncurses.def to
> enable "clear()" of the working terminal.
> I copied the ncurses.def file into the directory where I do the
> compilation. I imported the clear functionality from it.
> Than my Modula-2 file nicely compiles, but it does not link:
>
> gm2 -g -I.
> -I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim
> -I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/log
> -I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/min
> -flibs=pim,log -fmakeall ./SpinSimMain.mod
> make: Nothing to be done for 'SpinSimMain'.
> /tmp/ccDs7BDg.a(SpinSimMain.o): In function `Define_Batch':
> /home/slotboom/development/DEF_SIMU/./SpinSimMain.mod:1531:
undefined
> reference to `clear'
> collect2: error: ld returned 1 exit status
Forgive my ignorance but where is "-lncurses" being specified?
N.
>
> I have:
> *libncurses.so.5*
> and a
> *libncursesw.so.5*
>
> in the /lib/x86_64-linux-gnu directory and the .bashrc
> *LD_LIBRARY_PATH* includes this directory.
>
> One questions I have therefore:
>
> - are these the libraries I need to link the application to get
the
> "clear()" function working, or do I need another ncurses
library to be
> installed?
>
> Have a nice evening,
>
> Hans
>
> P.S. I have in the meantime got another MODULA-2 application
working
> (apart from the clear() function) and am very happy with it!
>
>
>
>
> On Fri, Jan 3, 2020 at 6:04 PM <address@hidden
<mailto:address@hidden>
> <mailto:address@hidden
<mailto:address@hidden>>> wrote:
>
>Â Â Â Send gm2 mailing list submissions to
>Â Â Â address@hidden <mailto:address@hidden>
<mailto:address@hidden <mailto:address@hidden>>
>
>Â Â Â To subscribe or unsubscribe via the World Wide Web, visit
>Â Â Â https://lists.nongnu.org/mailman/listinfo/gm2
>Â Â Â or, via email, send a message with subject or body 'help' to
>Â Â Â address@hidden <mailto:address@hidden>
<mailto:address@hidden <mailto:address@hidden>>
>
>Â Â Â You can reach the person managing the list at
>Â Â Â address@hidden <mailto:address@hidden>
<mailto:address@hidden <mailto:address@hidden>>
>
>Â Â Â When replying, please edit your Subject line so it is
more specific
>Â Â Â than "Re: Contents of gm2 digest..."
>
>
>Â Â Â Today's Topics:
>
>Â Â Â Â 1. Re: Using pim/log/ulm together and clearing terminal
>Â Â Â Â Â Â (Gaius Mulley)
>
>
>Â Â
 ----------------------------------------------------------------------
>
>Â Â Â Message: 1
>Â Â Â Date: Fri, 03 Jan 2020 13:42:09 +0000
>Â Â Â From: Gaius Mulley <address@hidden
<mailto:address@hidden> <mailto:address@hidden
<mailto:address@hidden>>>
>Â Â Â To: Johannes Slotboom <address@hidden
<mailto:address@hidden>
>Â Â Â <mailto:address@hidden
<mailto:address@hidden>>>
>Â Â Â Cc: address@hidden <mailto:address@hidden>
<mailto:address@hidden <mailto:address@hidden>>
>Â Â Â Subject: Re: Using pim/log/ulm together and clearing
terminal
>Â Â Â Message-ID: <address@hidden
<mailto:address@hidden>
>Â Â Â <mailto:address@hidden
<mailto:address@hidden>>>
>Â Â Â Content-Type: text/plain
>
>Â Â Â Johannes Slotboom <address@hidden
<mailto:address@hidden>
>Â Â Â <mailto:address@hidden
<mailto:address@hidden>>> writes:
>
>Â Â Â > Dear Gaius,
>Â Â Â >
>Â Â Â > I have my old Logitech Modula-2 program compiling
again, and I
>Â Â Â am very
>Â Â Â > happy about that!!!
>Â Â Â >
>Â Â Â > Since my program is a late 80tees beginning 90tees
style where the
>Â Â Â > user interactively selects from presented text menus
in the console
>Â Â Â > (newly bash-shell) I am in need for an equivalent for
the Logitech
>Â Â Â > Modula-2 "Screenmode(3)" functionalityt which cleared
the DOS-screen
>Â Â Â > and printed the new menu from the top of the screen again.
>Â Â Â >
>Â Â Â > I tried to simulate this behaviour by writing
character 33:
>Â Â Â >
>Â Â Â > Write( CHR(33) );
>Â Â Â >
>Â Â Â > ( CHR(33) should be the erase shell character.)
>Â Â Â >
>Â Â Â > however this unfortunately does not work. Than I saw
that in the Ulm
>Â Â Â > library there is a module called "CallShell" in which
I plan to call
>Â Â Â > "clear" which would do the trick (I hope at least).
>Â Â Â > VAR status: CARDINAL;
>Â Â Â > BOOLEAN response := PROCEDURE Shell( "clear", status );
>
>Â Â Â Hi Hans,
>
>Â Â Â yes the special character codes are not interpreted (yet) in
>   Display/Terminal. This could be added though. At
present there is a
>Â Â Â substitute - which is to use the ncurses.def found in
the examples:
>
>Â Â Â
http://git.savannah.gnu.org/cgit/gm2.git/tree/gcc-versionno/gcc/m2/examples/ncurses/ncurses.def
>
>Â Â Â there are a few tiny example programs in the same directory.
>
>Â Â Â > however if I try the latter there seem to be a problem
with
>Â Â Â using the
>Â Â Â > pim and ulm libraries. Namely trying to build my
application with:
>Â Â Â >
>Â Â Â > gm2 -g -I. -
>Â Â Â >
I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim -
>Â Â Â >
I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/log -
>Â Â Â >
I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/min -
>Â Â Â >
I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/ulm -
>Â Â Â > flibs=pim,log,ulm -fmakeall ./ilv.mod
>Â Â Â >
>Â Â Â > results in the following terminal output:
>Â Â Â >
>Â Â Â > gm2 -c -fmakeall0 -
>Â Â Â > B/home/slotboom/opt/lib/gcc//x86_64-pc-linux-gnu/8.2.0 -g
>Â Â Â -fonlylink -
>Â Â Â > fobject-path=. -
>Â Â Â >
>Â Â
 fobject-path=/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim
>Â Â Â >
>Â Â
 -fobject-path=/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/log
>Â Â Â >
>Â Â
 -fobject-path=/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/min
>Â Â Â >
>Â Â
 -fobject-path=/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/ulm
>Â Â Â > -ftarget-ar=/usr/bin/ar -ftarget-ranlib=/usr/bin/ranlib
>Â Â Â -fplugin=m2rte
>Â Â Â > -flibs=pim,log,ulm -fmakeall -I. -
>Â Â Â >
I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim -
>Â Â Â >
I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/log -
>Â Â Â >
I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/min -
>Â Â Â >
I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/ulm -
>Â Â Â >
I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim -
>Â Â Â >
I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/log -
>Â Â Â >
I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/ulm -I -I .
>Â Â Â > /ilv.mod
>Â Â Â >
/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/ulm/libulm.a
>Â Â Â > (libulm_la-SYSTEM.o): In function `_M2_SYSTEM_init':
>Â Â Â >
>Â Â
 /home/slotboom/build-8.2.0/x86_64-pc-linux-gnu/libgm2/libulm/SYSTEM.c:622:
>Â Â Â > multiple definition of `_M2_SYSTEM_init'
>Â Â Â >
/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim/libgm2.a
>Â Â Â >
>Â Â
 (SYSTEM.o):/home/slotboom/build-8.2.0/x86_64-pc-linux-gnu/libgm2/libpim/SYSTEM.def:20:
>Â Â Â > first defined here
>Â Â Â >
/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/ulm/libulm.a
>Â Â Â > (libulm_la-SYSTEM.o): In function `_M2_SYSTEM_finish':
>Â Â Â >
>Â Â
 /home/slotboom/build-8.2.0/x86_64-pc-linux-gnu/libgm2/libulm/SYSTEM.c:773:
>Â Â Â > multiple definition of `_M2_SYSTEM_finish'
>Â Â Â >
/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim/libgm2.a
>Â Â Â >
>Â Â
 (SYSTEM.o):/home/slotboom/build-8.2.0/x86_64-pc-linux-gnu/libgm2/libpim/SYSTEM.def:20:
>Â Â Â > first defined here
>Â Â Â > collect2: error: ld returned 1 exit status
>Â Â Â >
>Â Â Â > So my additional question (apart from erasing the bash
shell) is the
>Â Â Â > question whether the ulm, log, pim and iso libraries
cannot be used
>Â Â Â > together in one application?
>
>Â Â Â it should be possible to use pim, iso and log in a
single application.
>Â Â Â The ulm is probably best to work with alone (or maybe
with pim).
>Â Â Â If you
>Â Â Â use coroutines then you have to decide on a particular
paradigm
>Â Â Â and not
>   mix them :-). In conclusion they are designed to work
together but if
>Â Â Â the modules utilise aspects of SYSTEM.def/mod which
contain different
>Â Â Â declarations of the same named entity then problems arise,
>
>Â Â Â hope that helps,
>
>Â Â Â regards,
>Â Â Â Gaius
>
>
>
>Â Â Â ------------------------------
>
>Â Â Â Subject: Digest Footer
>
>Â Â Â _______________________________________________
>Â Â Â gm2 mailing list
>Â Â Â address@hidden <mailto:address@hidden>
<mailto:address@hidden <mailto:address@hidden>>
>Â Â Â https://lists.nongnu.org/mailman/listinfo/gm2
>
>
>Â Â Â ------------------------------
>
>Â Â Â End of gm2 Digest, Vol 157, Issue 2
>Â Â Â ***********************************
>
------------------------------
Subject: Digest Footer
_______________________________________________
gm2 mailing list
address@hidden <mailto:address@hidden>
https://lists.nongnu.org/mailman/listinfo/gm2
------------------------------
End of gm2 Digest, Vol 157, Issue 5
***********************************