I have this code:
01 MOUSE-FLAGS PIC 9(4).
01 MOUSE-FLAGS-AN redefines MOUSE-FLAGS PIC X(4).
InitialSettings.
*> sets in order to detect the PgUp, PgDn, PrtSc(screen print), Esc keys,set environment 'COB_SCREEN_EXCEPTIONS' TO 'Y'.set environment 'COB_SCREEN_ESC' TO 'Y'.display ' ' at 0101 with blank screen end-display. *> initialize pdcurses
*> make mouse active
COMPUTE MOUSE-FLAGS = COB-AUTO-MOUSE-HANDLING
+ COB-ALLOW-LEFT-DOWN
+ COB-ALLOW-MIDDLE-DOWN
+ COB-ALLOW-RIGHT-DOWN
+ COB-ALLOW-MOUSE-MOVE
display 'Row & Col.....:' at 1537
BACKGROUND-COLOR BCLR FOREGROUND-COLOR FCLR end-display
display MOUSE-FLAGS at 1553
BACKGROUND-COLOR CLRRED FOREGROUND-COLOR FCLR end-display
DISPLAY " Enter Key to continue..."
accept wDummy at 2580
SET environment "COB_MOUSE_FLAGS"
to FUNCTION NUMVAL(MOUSE-FLAGS-AN).
SET environment "COB_MOUSE_FLAGS" to MOUSE-FLAGS.
It compiles without errors but when I run it, I get this message:
FINISHED!
C:\EOS\source>mouse
configuration error:
invalid value 'mouse-flags' for configuration tag 'COB_MOUSE_FLAGS';
should be numeric
If I SET environment "COB_MOUSE_FLAGS" to MOUSE-FLAGS-AN.
I get this message:
FINISHED!
C:\EOS\source>mouse
configuration error:
invalid value 'mouse-flags' for configuration tag 'COB_MOUSE_FLAGS';
should be numeric
invalid value 'ô' for configuration tag 'COB_MOUSE_FLAGS';
should be numeric
From what I've read, COB_MOUSE_FLAGS should be set to a numeric. So, I tried
SET environment "COB_MOUSE_FLAGS"
to FUNCTION NUMVAL(MOUSE-FLAGS-AN).
I get
FINISHED!
C:\EOS\source>mouse
configuration error:
invalid value 'mouse-flags' for configuration tag 'COB_MOUSE_FLAGS';
should be numeric
invalid value 'ô' for configuration tag 'COB_MOUSE_FLAGS';
should be numeric
I must be doing something wrong?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'd also suggest to drop that curs_set call and parameter passing.
Apart from this: you use GCC on win32, which allows to diretly link against a .dll - so you can drop all of the related options and just use C:\EOS\GNUCobol\bin\pdcurses.dll instead. If you have an older version of GnuCOBOL which does not pass it to the linker, then prefix it with -Q option.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to compile the MOUSETEST.cbl program at
https://sourceforge.net/p/gnucobol/discussion/contrib/thread/2fbc76894c/
I have this code:
01 MOUSE-FLAGS PIC 9(4).
01 MOUSE-FLAGS-AN redefines MOUSE-FLAGS PIC X(4).
to FUNCTION NUMVAL(MOUSE-FLAGS-AN).
SET environment "COB_MOUSE_FLAGS" to MOUSE-FLAGS.
It compiles without errors but when I run it, I get this message:
FINISHED!
C:\EOS\source>mouse
configuration error:
invalid value 'mouse-flags' for configuration tag 'COB_MOUSE_FLAGS';
should be numeric
If I SET environment "COB_MOUSE_FLAGS" to MOUSE-FLAGS-AN.
I get this message:
FINISHED!
C:\EOS\source>mouse
configuration error:
invalid value 'mouse-flags' for configuration tag 'COB_MOUSE_FLAGS';
should be numeric
invalid value 'ô' for configuration tag 'COB_MOUSE_FLAGS';
should be numeric
From what I've read, COB_MOUSE_FLAGS should be set to a numeric. So, I tried
SET environment "COB_MOUSE_FLAGS"
to FUNCTION NUMVAL(MOUSE-FLAGS-AN).
I get
FINISHED!
C:\EOS\source>mouse
configuration error:
invalid value 'mouse-flags' for configuration tag 'COB_MOUSE_FLAGS';
should be numeric
invalid value 'ô' for configuration tag 'COB_MOUSE_FLAGS';
should be numeric
I must be doing something wrong?
The linked thread [2fbc76894c] has at its end a link to a demo program https://sourceforge.net/p/gnucobol/contrib/HEAD/tree/trunk/tools/TUI-TOOLS/GC99MOUSEDEMO.COB - does it work if you compile that (or a minimal adaption of it)?
Related
Discussion: 2fbc76894c
you can try to bypass the problem by commenting the statement
call static "curs_set" using by value wInt end-call
The program works the same
I'd also suggest to drop that
curs_set
call and parameter passing.Apart from this: you use GCC on win32, which allows to diretly link against a .dll - so you can drop all of the related options and just use
C:\EOS\GNUCobol\bin\pdcurses.dll
instead. If you have an older version of GnuCOBOL which does not pass it to the linker, then prefix it with-Q
option.