C Language Development Kit/Functions/GotoXY
From OptiWiki
| Description | This function moves the cursor position to a new location. | ||||||||||||||||||||||||||||||||||||||||
| Syntax | void gotoxy(int x, int y); | ||||||||||||||||||||||||||||||||||||||||
| Arguments | The arguments x and y specify the new position of the cursor on the display.
int x, int y | ||||||||||||||||||||||||||||||||||||||||
| Returns | None | ||||||||||||||||||||||||||||||||||||||||
| Remarks | gotoxy() uses character coordinates. This means that gotoxy(0,1) places the cursor underneath the first character on the second line. Since the size of a character depends on the selected font, the exact physical location of the cursor after a call to gotoxy() is dependent on the font type in use.
The character coordinates of the upper left corner are (0,0). The character coordinates of the bottom right corner when using a system font is:
Note: with the PHL1300 it depends on cursor() with the ICONS/NOICONS option what the actual screen size will be. The PHL terminals can be placed in a special mode in which gotoxy() will assume that there are 8 lines, regardless of the selected font. This mode is for compatibility with older models handheld terminals. This mode can be switched on and off by a call to systemsetting(). | ||||||||||||||||||||||||||||||||||||||||
| Example | #include "lib.h" #include <stdio.h> void main( void ) { printf("\f"); gotoxy(0,1); printf("Second line"); while( 1 ) idle(); } |
