gotoxy()

This is a discussion on gotoxy() within the C Programming forums, part of the General Programming Boards category; is there a way to get the current courser position.., so if I put that in the position numbers in ...

  1. #1
    Registered User Commander's Avatar
    Join Date
    Sep 2001
    Posts
    804

    gotoxy()

    is there a way to get the current courser position.., so if I put that in the position numbers in the gotoxy() function, it'll stay in the same spot?
    thnkx
    oh i'm sorry! i didn;t realize my fist was rushing to meet ur face!

    MSN :: commander_android@hotmail.com []*[]

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    In my compiler (Borland 5.5) I have wherex() and wherey(). Maybe you have these?

    I only found them by opening conio.h and looking to see what function prototypes are in there.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    It's not terribly difficult to create a Windows implementation of wherex and wherey with gotoxy from the FAQ.
    Code:
    #include <windows.h>
    
    COORD coord;
    
    void gotoxy(int x, int y)
    {
      coord.X = (short)x;
      coord.Y = (short)y;
      SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
    }
    
    int wherex ( void )
    {
      return coord.X;
    }
    
    int wherey ( void )
    {
      return coord.Y;
    }
    -Prelude
    My best code is written with the delete key.

  4. #4
    Registered User Commander's Avatar
    Join Date
    Sep 2001
    Posts
    804
    thankx guys
    oh i'm sorry! i didn;t realize my fist was rushing to meet ur face!

    MSN :: commander_android@hotmail.com []*[]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What is gotoxy??
    By Beachblue in forum C Programming
    Replies: 6
    Last Post: 11-23-2008, 01:24 AM
  2. Tic Tac Toe movement
    By $l4xklynx in forum Game Programming
    Replies: 4
    Last Post: 11-06-2008, 07:22 PM
  3. gotoxy(); help!!
    By clique in forum C Programming
    Replies: 2
    Last Post: 10-07-2008, 05:08 AM
  4. Want to see if I am using gotoxy the right way ...
    By o0obruceleeo0o in forum C++ Programming
    Replies: 5
    Last Post: 04-22-2003, 05:17 PM
  5. Is gotoxy ansi?
    By MeneLaus in forum C Programming
    Replies: 2
    Last Post: 05-18-2002, 03:48 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21