GW-BASIC is a dialect of the programming language BASIC developed by Microsoft in the 1980s, and was included in most versions of MS-DOS. It is similar to Microsoft/IBM BASICA, but is a fully self-contained executable.
Questions tagged [gw-basic]
41 questions
13
votes
2 answers
Unknown GW-BASIC function/syntax: Q(var) = var
I'm translating an excessively old GW-BASIC program into JavaScript, and I've come across a piece of syntax that has me stumped. Note (again): totally not my code, and the variable names are all insane, which is why I'm porting it in the first…

b. e. hollenbeck
- 6,493
- 7
- 32
- 47
10
votes
3 answers
How to create a plain text file in GW-BASIC 2.01?
My dad learnt programming in the 80s and he is still stuck with GW-BASIC (and making a living out of it). He was asked to create a CSV file, but he only knows how to create files of fixed-width records.
I found on the web that the syntax for opening…

Roberto Bonvallet
- 31,943
- 5
- 40
- 57
8
votes
5 answers
How to run GW-Basic under Ubuntu?
Well, I suddenly missed GW-Basic very much, so I want to install one in my new Ubuntu box. I have a long time not programmed for GW-Basic, so I don't know if there comes new releases. I copied GWBASIC.EXE from my old DOS 3.3 box, but it seems not…

Lenik
- 13,946
- 17
- 75
- 103
8
votes
4 answers
How can I exit Microsoft GW-BASIC, IBM BASICA, or other similar old dialects of BASIC?
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…

MD XF
- 7,860
- 7
- 40
- 71
7
votes
13 answers
Why is GW-BASIC still taught in schools?
I dunno about USA and the UK, but in India, schools still teach GW-BASIC. Yes, it's:
10 PRINT "HELLO WORLD"
20 GOTO 10
As far as my experience goes, even writing assembler is easier than this mess of a language. It could easily be replaced by…

aviraldg
- 9,531
- 6
- 41
- 56
6
votes
1 answer
Print without newline
In BASIC I know of two instructions to print to the screen, PRINT, and WRITE, both of which automatically print strings with a newline at the end. I want to print a string without a newline. How can I do this? I'm using GW-BASIC.

MD XF
- 7,860
- 7
- 40
- 71
6
votes
2 answers
How do I view the source code of a GW-BASIC .BAS file?
I have an old .BAS file that I'm trying to view and for which I'm running into some problems. Searching online seems to indicate that I should be able to just open it in NOTEPAD.EXE or similar, but doing so gives me gibberish, like…

user2320886
- 103
- 1
- 6
5
votes
1 answer
Was there ever a first parameter for the CLEAR statement?
In both GW-BASIC and QuickBASIC, statements are passed arguments, some of which are optional and can be omitted depending on the statement:
REM Move the text cursor to the specified column and row.
LOCATE row%, column%
REM Move the text cursor to…
user539810
5
votes
2 answers
How do I refactor out GOTO statements in GWBASIC code?
I'm currently refactoring a heap of old GWBASIC code into python so it can be run on newer machines. They're all old engineering mathematics programs which are quite maths heavy as well as using the GOTO statement massively throughout.
I'm just…

aw4lly
- 2,077
- 1
- 12
- 13
4
votes
1 answer
What's the meaning of GW in GW-BASIC?
GW-Basic was my first programming language. And i never found out what the 'GW' stands for.

Cengiz
- 5,375
- 6
- 52
- 77
4
votes
5 answers
How to test if a directory exist in qbasic?
I'm writing a program in Qbasic.
I'd like to know how to test if a folder exists.
The idea is:
IF "c:\user\basic\blablabla\" exists (?? how to programm the "exist" test?)
THEN CHDIR "c:\user\basic\blablabla\"
ELSE
MKDIR…

manny-
- 129
- 2
- 10
4
votes
1 answer
Syntax error message with GW-BASIC
I am currently stymied by the following error message from GW-BASIC:
Syntax error in 450
Ok
450 STEP=0
Here is the context:
400 ON KEY(13) GOSUB 590 ' right arrow key makes direction clockwise
410 ON KEY(12) GOSUB 610 ' left arrow key makes…

user46019
- 41
- 1
4
votes
1 answer
GWBASIC programming language with total size of 79KB only How?
A programming Language only 79kb in size.
GWBASIC programming language confuse me, i download it and its size is only 79KB only how this is possible? i never seen a language with 79kb of size before.
Other programming language like mysql its size…

Leonard
- 240
- 3
- 13
3
votes
3 answers
How to write a program in gwbasic for adding the natural numbers for 1 to 100?
I am trying to write a program for adding the natural numbers from 1 to n (1 + 2 + 3 + ... + n). However, the sum appears 1 when I use if statement. And when I use for-next statement there is a syntax error that I don't understand.
if:
30 let s =…

GoldenSnowflakes
- 33
- 3
3
votes
2 answers
Nested IF...THEN...ELSE in GW-BASIC
I use following block of code to test some conditions in gw-basic program.
IF Average >= 80 AND Average <= 100 THEN Grade$ = "A"
IF Average >= 70 AND Average <= 79 THEN Grade$ = "B"
IF Average >= 60 AND Average <= 69 THEN Grade$ = "C"
IF Average >=…

maliks
- 1,102
- 3
- 18
- 42