Previous Topic Next topic Print topic


cobmove

Moves the virtual cursor to the specified line and column on the screen.
Restriction: This function is supported for native COBOL only.

Syntax:

#include "cobscreen.h"

void cobmove (int y, int x);

Parameters:

y The line number to move the virtual cursor to
x The column number to move the virtual cursor to

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.

Equivalent COBOL Syntax:

call "CBL_PUT_SCR_POS" using ... 

Example:

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);
}
Previous Topic Next topic Print topic