Page 1 of 1

ending/quiting a qbasic program

Posted: Mon May 25, 2009 8:56 pm
by ozthor
this has got to be easy...

but not being a big user of qbasic, i'm lost...

how do you exit a qbasic program???

once the program has run, done its work, how do you get it to close the qbasic window....

to get right out of the qbasic evnirement????

Posted: Mon May 25, 2009 9:29 pm
by jasbales
End your code with the keyword SYSTEM

Posted: Mon May 25, 2009 10:02 pm
by ozthor
sorry but system is not working

what ever I do... the program runs, once finished, I get the message..

press any key to continue

at which time you are then returned to the listing of the program code....

that is the end..

Posted: Mon May 25, 2009 10:57 pm
by iamdenteddisk
here are some way's usualy included in a programs code
hitting ESC key
hitting Q
at a prompt
stop
exit
quit
end
system

these are usualy in the code but if not here are a few key strokes you can try.
"ctrl & pause/break" stops the execution and brings back the qb enviroment from there use mouse to "file then exit"

"alt & ESC" will minimize the current window and from there you can right click on the minimized name in the bar bellow and then select "close".

"Ctrl&alt&deleate" will bring up task manager from there choose the program to end and hit "end task"

if the last one doesn't do as I said you may be using a different windows version and you can use "alt&F4" to do the same with taks manager in those other versions.

Else you may have a frozen machine and you can try holding in the power switch on the front of your tower case for 10 seconds and that will halt and power down the machine. this one will work but can corupt older HDD's that need to park first. ifso you will need to run scandisk before restarting windows unless it does it automaticly.

that is it cut and dry you should be able to stop execution of any unwanted program now..good luck.

Posted: Mon May 25, 2009 11:57 pm
by burger2227
SYSTEM does not exit the QB IDE (editor) if you started a program in the IDE by pressing F5!

To exit the IDE use the File menu. Save changes if you made any.

SYSTEM only returns a BAS file to DOS if it was started in DOS. That way, it runs similar to an EXE program.

To exit without the IDE, you need to run it using a command line or a batch file. IF you stop the program, you will have to exit the IDE yourself.

I don't recommend EVER using END!

PS: DementedDisk, WHAT are you talking about? Nonsense!

Posted: Tue May 26, 2009 1:24 am
by jasbales
I've had problems with the QB IDE, so I've learned to do things without it. I have a batch file associated with the .BAS file extension. The batch takes care of things. I just run .BAS files like an .EXE. With SYSTEM I never have to see the IDE

Posted: Tue May 26, 2009 12:59 pm
by burger2227
Beginners should use the IDE. Those "PROBLEMS" indicate some errors you made coding in the editor. This usually helps new people. I STILL use the IDE most times! You can turn off Syntax checking in QB4.5.

When you don't use it, you often can get errors and then waste MORE time trying to finding them! The IDE stops at each error and usually points to the error's position.

Don't be afraid of the IDE! Use it to help you.

Ted

Posted: Tue May 26, 2009 1:56 pm
by jasbales
The problems might not be with the IDE itself. I'm running QB on a laptop with a touchpad. Much of the time I cannot get the IDE to respond to the movements on the touchpad and sometimes the menus will not work properly when I'm using my laptop's keyboard.

I still use QB.exe to interpret my code. If there are any errors in the code it goes straight to it and I can fix it. I just call QB.exe from Programmer's Notepad instead of the QB IDE. I also open my code in the IDE and save it to get all my keywords upper case. I can call the IDE, save, and exit the IDE in like a second.

As soon as I get a monitor for my old desktop I'll be able to use the QB IDE more, but things being the way they are for me right now, I'm not going to hold my breath and wait for a monitor to appear.

Posted: Tue May 26, 2009 2:20 pm
by ozthor
thanks for the input everyone....


I'm running the program from a bat file, which in turn is ran from another program....

I was trying to remove the need for the user, who ever it be from the need of closing down the qbasic window once it had finished running....

Dead line for this has passed for now....

so I'll go back to getting the program to work under a enviroment where I am able to do this with...


the problem came about becouse of the number of floting point numbers...
within the program.
I now have the time to get the syntext right...


thanks everyone

Posted: Tue May 26, 2009 7:12 pm
by bongomeno
there are command line options that exit qb when run from a batch file...


QBASIC source.bas /RUN

Actualy

Posted: Wed May 27, 2009 12:01 am
by iamdenteddisk
Sorry let me rephrase that as saying, sometimes you can type at a prompt inside a program the word "SYSTEM" as a command that will bring you back to the QB enviroment - burger. along with other commands being possible too.