Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with QB4.5
#1
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.
Reply
#2
"SLEEP: flush$ = INKEY$", or:

1 IF INKEY$ = "" THEN GOTO 1
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#3
Thankyou Very Much
Reply
#4
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).
url=http://www.copy-pasta.com]CopyPasta[/url] - FilePasta
Reply
#5
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)
Antoni
Reply
#6
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
Life is like a box of chocolates', hrm, WTF, no it isn't, more like, 'life is like a steaming pile of horse crap.'
Reply
#7
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)