delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/16/00:18:12

Message-ID: <39999CF9.71666B5A@ntlworld.com>
From: Steven Watson <steven DOT watson AT ntlworld DOT com>
X-Mailer: Mozilla 4.7 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How to move the cursor into a costum position.
References: <8nc2kp$79u$1 AT venus DOT telepac DOT pt>
Lines: 42
Date: Tue, 15 Aug 2000 20:41:45 +0100
NNTP-Posting-Host: 62.254.82.88
X-Complaints-To: abuse AT net DOT ntl DOT com
X-Trace: news6-win.server.ntlworld.com 966368797 62.254.82.88 (Tue, 15 Aug 2000 20:46:37 BST)
NNTP-Posting-Date: Tue, 15 Aug 2000 20:46:37 BST
Organization: ntlworld News Service
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi Paulo,
This snippet may help

#include <stdio.h>
#include <conio.h>
#include <pc.h>
#define cursor(x,y) ScreenSetCursor(x,y)
#define curr_cursor(x,y) ScreenGetCursor(x,y)

int main(void)
{
int x=0,y=0;
    curr_cursor(&x,&y);/*get cursor position this does nothing 
but it shows how to */
    x+=2;
    y+=2;
    cursor(x,y);/*set position*/
    printf( "hello world\n");/* Print some text at position*/
    x+=2;
    cursor(x,y);/*now move to next position*/
    printf( "hello world\n"); /*Print some text at the new position */
getch();/* wait until keypress*/
return 0;
}

Steven 

"Paulo J. Matos aka PDestroy" wrote:
> 
> Given a x, y position how can I put the cursor there to do whatever I want
> in C?
> 
> Best regards,
> 
> --
> Paulo J. Matos aka PDestroy
> http://www.pdestroy.net
> ICQ UIN - 361853
> 
> --
> To teach is to learn twice.
>            - Joubert, Joseph

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019