#include "cobscreen.h" void cobmove (int y, int x);
y | The line number to move the virtual cursor to |
x | The column number to move the virtual cursor to |
call "CBL_PUT_SCR_POS" using ...
The following code displays a simple counter:
int secs = 10; char *message = "Time Left: "; cobmove(10, 10); cobprintf("%s%d", message, secs); while (secs--) { sleep(1); cobmove(10, 10 + strlen(message)); cobprintf("%2d", secs); }
Comments:
The virtual cursor as used by the routines in this section is moved to the line and column values as specified by the y and x parameters.
The virtual cursor home position of the top left-hand corner is (0,0), that is, a y value of 0 and an x value of 0. The virtual cursor is thread-local, that is, each thread has its own virtual cursor.