Qbasicnews.com

Full Version: Problem with QB4.5
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm looking for some kind of Pause statement for QuickBasic, as whenever I compile a program, it appears for about a second. Then, it closes. This is after i've compiled it. Thankyou for any help.
"SLEEP: flush$ = INKEY$", or:

1 IF INKEY$ = "" THEN GOTO 1
Thankyou Very Much
Aga you and your GOTOs hehe....

same as two without GOTOs in case you prefer that, I'm not saying its better, just want to show it:

Code:
DO: LOOP WHILE $INKEY=""

But mostly I use SLEEP when I'm testing (later your program might have menues and such, and you won't need it anymore).
To keep windows from closing window when program ends
Right- Click your program in the Explorer, go to Properties
and Uncheck "Close window at end" (something like this, I'm translating from spanish)

To make your program wait for a key to terminate add this last line
Code:
a$=input$(1)
The problem with all those methods is that if there is still something in the buffer or the user is still holding a key down it won't help.

I personally use this one:

Code:
' ---=[ Sub ForceWait ]=---
'
' Force the user to wait until a key is pressed.
' Insures that the current keyboard buffer contents are
' discarded first.
'
Sub ForceWait ()

   While Inkey$ > "": Wend
   While Inkey$ = "": Wend

End Sub
You must be compiling from the IDE. You cant pause it when you compile from the IDE. You have two choices:
1. Compile outside the IDE
2. Press F4 and look at the out put screen