Thread: Loops

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    14

    Loops

    Hi all ,

    I have written a program where I am inputting number of values from the user . This process i have added in a loop , but the problem is that whenever my first iteration is over and the 2nd iteration starts the previous value which i have taken in from the screen sttill remains there and dos'nt vanishes after i have press enter key
    and then for the next value I enters It overrights the contents .

    In doing all this the functionality of the problem is not affected only the look and feel looks a bit annoying .
    -----------------------------------------------------------------------------------

    output form the screen

    -----------------------------------------------------------------------------------

    Specify the X position : 0

    Specify the X position : 1

    __________________________________________________ __

    Now for the next iteration this 0 and 1 for X and Y position is still seen and does'nt dissappear

    Pls help

    regards
    Anil

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Redrawn the screen with no previous input on it.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    I think the OP is trying to clear the screen. You can see the FAQ on that topic.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #4
    Registered User
    Join Date
    Jan 2006
    Posts
    14
    hi ,

    Sorry , but i did'nt undustood .

    can u tell me wht the problem is ?

    regards
    Anil

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    What is there to understand?
    You managed to draw the screen once, just clear the screen and draw it again.

  6. #6
    Registered User
    Join Date
    Jan 2006
    Posts
    14
    Quote Originally Posted by Salem
    What is there to understand?
    You managed to draw the screen once, just clear the screen and draw it again.

    Hi Salem ,

    If i Clear the screen , the other objects associated with the screen also vanishes .

    thus the requirement is only the earlier variable shd vanish .

    I repost my request


    Hi all ,

    I have written a program where I am inputting number of values from the user . This process i have added in a loop , but the problem is that whenever my first iteration is over and the 2nd iteration starts the previous value which i have taken in from the screen sttill remains there and dos'nt vanishes after i have press enter key
    and then for the next value I enters It overrights the contents .

    In doing all this the functionality of the problem is not affected only the look and feel looks a bit annoying .
    -----------------------------------------------------------------------------------

    output form the screen

    -----------------------------------------------------------------------------------

    Specify the X position : 0

    Specify the X position : 1

    __________________________________________________ __

    Now for the next iteration this 0 and 1 for X and Y position is still seen and does'nt dissappear

    Pls help

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    So use a gotoxy(), or whatever else you have for moving around the screen and put a few spaces over where you input stuff.
    This just lacks imagination....

  8. #8
    Registered User
    Join Date
    Jan 2006
    Posts
    14
    Hi ,

    I had already done that but still the same fails , may be i might not explained my properly

    thanks any ways

    regards
    Anil

  9. #9
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Post your code, don't keep describing the problem/symptoms.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Loops Trouble
    By rlframpton in forum C Programming
    Replies: 2
    Last Post: 04-17-2009, 01:08 AM
  2. Too many loops D:
    By F5 Tornado in forum C++ Programming
    Replies: 6
    Last Post: 12-03-2007, 01:18 AM
  3. help with arrays and loops
    By jdiazj1 in forum C Programming
    Replies: 4
    Last Post: 11-24-2001, 04:28 PM
  4. for loops in C
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 10-15-2001, 05:09 PM
  5. exiting loops with ease?
    By KingRuss in forum Game Programming
    Replies: 3
    Last Post: 09-24-2001, 08:46 PM