gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

straight c grid example with ncurses not drawing grid ...any idea?


From: Jim McNamara
Subject: straight c grid example with ncurses not drawing grid ...any idea?
Date: Sat, 19 Oct 2024 20:25:37 +0000

cobc -x -o my_program init.cob $(pkg-config --cflags --libs ncurses) -static
$> ./NcursesInlineCExample.exe

this above... or this below... does not produce a grid

$> cobc -x -o NcursesInlineCExample init.cob -lncurses -static
$> ./NcursesInlineCExample.exe

it just kind of waits out there hanging around not doing anything...

IDENTIFICATION DIVISION.
PROGRAM-ID. NcursesInlineCExample.

       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  WS-RETURN-CODE    PIC S9(9) COMP.

       LINKAGE SECTION.
       01  C-RETURN-CODE     PIC S9(9) COMP.

       PROCEDURE DIVISION.
       MAIN-PROCEDURE.
           PERFORM C-INITIALIZE-NCURSES.
           IF WS-RETURN-CODE < 0
               DISPLAY "Failed to initialize ncurses."
           ELSE
               PERFORM C-SHOW-GRID
               PERFORM C-WAIT-FOR-KEY
           END-IF.
           PERFORM C-FINALIZE-NCURSES.
           STOP RUN.

       C-INITIALIZE-NCURSES.
           CALL 'initscr' USING C-RETURN-CODE.

       C-SHOW-GRID.
           CALL 'mvprintw' USING 1 1 "+---+---+".
           CALL 'mvprintw' USING 2 1 "| 1 | 2 |".
           CALL 'mvprintw' USING 3 1 "+---+---+".
           CALL 'mvprintw' USING 4 1 "| 3 | 4 |".
           CALL 'mvprintw' USING 5 1 "+---+---+".
           CALL 'refresh'.

       C-WAIT-FOR-KEY.
           CALL 'getch'.

       C-FINALIZE-NCURSES.
           CALL 'endwin'.
its the call to mvprintw that isnt executing right away thanks

jim




Sent with Proton Mail secure email.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]