ending/quiting a qbasic program

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
ozthor
Newbie
Posts: 5
Joined: Fri May 22, 2009 12:40 am

ending/quiting a qbasic program

Post by ozthor » Mon May 25, 2009 8:56 pm

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????

jasbales
Coder
Posts: 17
Joined: Mon Nov 22, 2004 11:36 am
Location: Prescott AZ
Contact:

Post by jasbales » Mon May 25, 2009 9:29 pm

End your code with the keyword SYSTEM

ozthor
Newbie
Posts: 5
Joined: Fri May 22, 2009 12:40 am

Post by ozthor » Mon May 25, 2009 10:02 pm

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....

iamdenteddisk
Veteran
Posts: 185
Joined: Mon Jun 30, 2008 4:10 pm

that is the end..

Post by iamdenteddisk » Mon May 25, 2009 10:57 pm

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.

User avatar
burger2227
Veteran
Posts: 2420
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 » Mon May 25, 2009 11:57 pm

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!
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

jasbales
Coder
Posts: 17
Joined: Mon Nov 22, 2004 11:36 am
Location: Prescott AZ
Contact:

Post by jasbales » Tue May 26, 2009 1:24 am

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

User avatar
burger2227
Veteran
Posts: 2420
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 » Tue May 26, 2009 12:59 pm

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
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

jasbales
Coder
Posts: 17
Joined: Mon Nov 22, 2004 11:36 am
Location: Prescott AZ
Contact:

Post by jasbales » Tue May 26, 2009 1:56 pm

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.

ozthor
Newbie
Posts: 5
Joined: Fri May 22, 2009 12:40 am

Post by ozthor » Tue May 26, 2009 2:20 pm

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

User avatar
bongomeno
Veteran
Posts: 231
Joined: Wed Dec 10, 2008 9:08 am
Location: San Bernardino CA
Contact:

Post by bongomeno » Tue May 26, 2009 7:12 pm

there are command line options that exit qb when run from a batch file...


QBASIC source.bas /RUN
Home: http://www.geekbasic.com" target="_blank
Forum: http://www.geekbasic.com/index.gbws?$page=forumsmain" target="_blank
QB64 powered web server: http://www.geekbasic.com/index.gbws?$pa ... inter=%201" target="_blank

iamdenteddisk
Veteran
Posts: 185
Joined: Mon Jun 30, 2008 4:10 pm

Actualy

Post by iamdenteddisk » Wed May 27, 2009 12:01 am

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.

Post Reply