Thread: gotoxy & clrsrc

  1. #1
    Unregistered
    Guest

    Question gotoxy & clrsrc

    What do I have to do to be able to use "gotoxy(x,y);" and "clrsrc;"?

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    Unregistered
    Guest
    Hmmmm that still didn't seem to work. mY compiler is microsoft visual c++, and it is said that it only does windows, and not dos. could that be the problem?

  4. #4
    Registered User
    Join Date
    Aug 2001
    Posts
    223

    gotoXY

    gotoXY() is a function console function in boorland's conio.h


    instead you must include <wincon.h> and <winbase.h>
    or I think that if you simply include <windows.h> that will do the trick...



    and use some of the console functions

    Code:
       COORD dwCordinates;
    
      dwCordinates.X = 20;
      dwCordinates.Y = 20;
    
      HANDLE consoleHandle = GetStdHandle( STD_OUTPUT_HANDLE );
     
      /*
      STD_INPUT_HANDLE
      STD_OUTPUT_HANDLE Standard output handle 
      STD_ERROR_HANDLE 
      */
    
     SetConsoleCursorPosition( consoleHandle, dwCordinates);

    ...oh by the way ... to clear the screen
    #include<process.h>

    ....
    system("cls");
    ....


    there a bunch of console functions if you want to perform a search for them in your help files...using the keywords
    Console Functions
    zMan

  5. #5
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    #include<process.h>

    ....
    system("cls");
    ....
    Wrong! system is in stdlib on every compiler I've ever used...

    What does the FAQ version do wrong?

  6. #6
    Registered User
    Join Date
    Aug 2001
    Posts
    223

    system(...)

    it's in both files.... see line 145 of process.h
    zMan

  7. #7
    Unregistered
    Guest

    Cool

    Thanks you guys are great you helped a lot!!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Tic Tac Toe movement
    By $l4xklynx in forum Game Programming
    Replies: 4
    Last Post: 11-06-2008, 07:22 PM
  2. Why do I need function for gotoxy and not getche?
    By Beholder in forum C++ Programming
    Replies: 1
    Last Post: 12-11-2005, 03:19 PM
  3. Want to see if I am using gotoxy the right way ...
    By o0obruceleeo0o in forum C++ Programming
    Replies: 5
    Last Post: 04-22-2003, 04:17 PM
  4. gotoxy(), possible under ANSI?
    By Vber in forum C Programming
    Replies: 1
    Last Post: 11-18-2002, 08:50 AM
  5. Is gotoxy ansi?
    By MeneLaus in forum C Programming
    Replies: 2
    Last Post: 05-18-2002, 02:48 PM