Results 1 to 3 of 3

Thread: Keeping a console application open

  1. #1

    Thread Starter
    Hyperactive Member Art W.'s Avatar
    Join Date
    Apr 2002
    Location
    In My Own Little World, But that’s OK because they know me there!
    Posts
    271

    Keeping a console application open

    Hello Everyone:

    I am trying to remember how to stop a console application from closing after it has run. I want the window to remain on the screen until I am ready to close it.

    Thanks

    Art W.
    SLEEP: A Totally Inadequate Substation For Caffeine!

  2. #2
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Keeping a console application open

    Something like

    dim foo as boolean = true
    do while foo
    console.writeline("QUIT?")
    if console.readline().toupper="Y" then
    foo = false
    else
    'code
    end if
    loop
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  3. #3
    Junior Member
    Join Date
    Dec 2010
    Posts
    28

    Re: Keeping a console application open

    This too would work...
    Code:
            'stops console window from closing prematurely
            Console.WriteLine("Press ENTER to EXIT")
            Console.ReadLine().ToUpper()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width