Thread: system() help

  1. #1
    ------------
    Join Date
    Jun 2005
    Posts
    79

    system() help

    Ok, i decided to start on my mud (which is comming easier than i expected BTW...) and im trying to make it write to a file but i keep getting errors trying to clear the screen and pause the screen... i looked on google and the websites said to use:
    Code:
    system("PAUSE");
    
    and
    
    system("CLR");
    but that just gives an error... anyone know how to do it?
    Last edited by Goosie; 06-23-2005 at 04:26 PM. Reason: wrong title :D stupid me...
    CAUTION: Newbie at programming!
    -------------------------------------------------
    Thanks everyone who helped me with all the questions, and utter lost-ness i happen to have... it is VERY VERY much appreciated

  2. #2
    *this
    Join Date
    Mar 2005
    Posts
    498
    look in the tutorials section on this site, this has been covered many times.

  3. #3
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    system("CLS"); its cls not clr

  4. #4
    *this
    Join Date
    Mar 2005
    Posts
    498
    Its really bad to use system calls, you should try to never use them because they spawn another process to do the work for you. read the tutorials on cprogramming.com

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    17
    did u include stdlib.h?

  6. #6
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    Here is an example to freeze the screen, use on your header files as #include conio.h
    then, when you want to hold the screen, type the command getch(); this will wait for the user to press a key, although I would advise you putting somthing like
    "cout << "Press a key to carry on", then under getch(); put cin.ignore(); then it will not read the key the user has pressed.

    As for clearing the screen, I would go with the above advise, I do use system("cls"); but am looking into ways to rectafy my code

  7. #7
    Registered User
    Join Date
    Jun 2005
    Posts
    32
    I know for a fact that one call is clrscr(); but i have only ever gotten it to work with the borland compiler (On windows that is). Whenever i use MSVC i use system("cls"); as well... but clrscr() does exsist if you use borland.

  8. #8
    Learn from the llama Marlon's Avatar
    Join Date
    Jun 2005
    Location
    South africa
    Posts
    25
    I heard that it is unwise to use system processes coz for some reason they might not exist,but i dont know if it is true is pause an external command? if it is,than is is possible that pause doent exist causing your program to malfunction or something. Just my opinion, im still pretty green so i dont know if im talking rubbish.
    `Who are YOU?' said the Caterpillar.
    This was not an encouraging opening for a conversation. Alice replied, rather shyly, `I--I hardly know, sir, just at present-- at least I know who I WAS when I got up this morning, but I think I must have been changed several times since then.' - Lewis Caroll's Alice in Wonderland.

  9. #9
    *this
    Join Date
    Mar 2005
    Posts
    498
    Quote Originally Posted by JoshR
    Its really bad to use system calls, you should try to never use them because they spawn another process to do the work for you. read the tutorials on cprogramming.com
    search the boards and read the FAQ and look through the tutorials, system calls are NOT good to use, im seriouse this has been answered tooooooooooooooooooo many times and there doesnt need to be another thread on it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File System Implementation
    By dodgeviper in forum C Programming
    Replies: 9
    Last Post: 11-16-2007, 01:04 PM
  2. Using system icons
    By @nthony in forum Windows Programming
    Replies: 1
    Last Post: 01-13-2007, 07:56 PM
  3. Linux database system needed
    By BobS0327 in forum Tech Board
    Replies: 7
    Last Post: 06-11-2006, 03:56 PM
  4. BIOS system and memory allocation problem
    By beely in forum Tech Board
    Replies: 9
    Last Post: 11-25-2003, 07:12 AM
  5. Number system base M, print numbers N digits wide...
    By biterman in forum C Programming
    Replies: 12
    Last Post: 11-19-2001, 04:31 AM