How can I exit Microsoft GW-BASIC, IBM BASICA, or other similar old dialects of BASIC?
Asked Answered
M

4

9

Microsoft BASIC, GW-BASIC and BASICA all use a prompt that looks like this:

I can't figure out how to exit any of these. Typing END does not exit them. EXIT, QUIT, Q, Ctrl+C, and everything else that I can think of also does not work.

I'm sure there's a way to do this. I can't imagine everyone who used BASICA on DOS had to restart their machine every single time they wanted to exit the development environment.

So, how do I exit from the old BASIC editor prompt?

Monopoly answered 30/5, 2017 at 3:42 Comment(1)
BASICA is the new vim?Distrait
T
21

GWBASIC and its clones (e.g., IBM's BASIC and BASICA) exited to the DOS prompt with the command system.

Although redirection was possible even in early versions of MS-DOS/PC-DOS, the BASIC interpreter bypassed using the standard input and output streams, and had its own Ctrl-Break/Ctrl-C handler, so neither of those keystrokes would terminate the interpreter.
The shell command started a fresh copy of the system command interpreter (usually COMMAND.COM), or executed a system command and then returned to BASIC, but did not remove the interpreter from memory.

Tarter answered 30/5, 2017 at 6:48 Comment(2)
@PTBW - I believe that MBASIC was a GW-BASIC clone, or a cut-down version of it; I never used CP/M, however, so my knowledge of it is 'academic' or 'anecdotal'.Tarter
Oh that's right, system. An old, retired neuron just woke up.Jaco
R
7

Type "system" and hit enter to exit GW-BASIC in DOS.

Type "shell" and hit enter to go to DOS but still have GW-BASIC in memory. Type "exit" while in DOS to return to GW-BASIC.

Riffle answered 1/3, 2020 at 17:24 Comment(1)
Thanks. This is the only thing that worked if you are also running a dos emulator like dosbox.Benedetto
L
1

Usually for those command line editors Ctl-Z would do the trick since it sends the EOF character and thus signal terminating input.

If that doesn't do it, try typing system

Logorrhea answered 30/5, 2017 at 4:26 Comment(0)
D
0

According to the manual linked by paulsm4, CTRL-BREAK while output is being redirected will exit BASIC. It also says the SHELL command returns to the MS-DOS command shell. (On the original IBM PC, the BASIC was in ROM, and therefore always resident in memory.)

Distrait answered 30/5, 2017 at 6:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.