Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to end a program without the press any key prompt?

Status
Not open for further replies.

quebasic2

Programmer
Dec 17, 2002
174
IN
Does anyone know how to use asm to write an end command to a qbasic file, so the user will not get the press any key prompt?
 
Try using SYSTEM instead of END or STOP.
(I'm assuming you are using Qbasic or QuickBasic interpreter
IDE and not a compiled program).

>QBASIC /RUN progname

progname.bas
cls
print "hello"
system
 
Well, a program should end by itself when it reaches its last line...
If you are asking how to get out off a loop without user's intervention, you must set an end condition, it can be a calculation,a counter or a timeout

t!=TIMER+timeout

DO

doanything

LOOP UNTIL TIMER >t! Antoni
 
Even after you compile a qbasic program, and the program ends, or you end it. The user must press a key for the program to truely end. I would like to stop that.
 
put these as the very last lines of your program

def seg=&h40
poke &h1a, 25
def seg
 
That did not seem to work shanley06. Perhaps I am using it incorrectly.
 
If it is compiled it doesn't ask for a keypress, at least in none of my programs it never did.
 
You are right quebasicking. I was mistaken. This forum is closed.
 
quebasic2 are you sure you typed it in right? it works on my comp
 
If you run the program from the IDE (QBASIC or QuickBasic Editor) that will ALWAYS be the case (the prompt to press a key or enter) -- there's nothing you can do about that.

But using QBASIC /RUN progname
will end the program without the prompt if you use SYSTEM
as I suggested before.
 
If you use a bat file to load the program:
@echo off
c:\(location of qbasic) /run (filename)
then you can just type sytem as the command to exit and it will close it with out the "press any key to continue"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top