QBasic language is a variant of Basic programming developed by Microsoft in 1985. It was developed to make computer programs and various utilities for MS-DOS and windows 98/95 Operating system. It is easy to code and very easy to understand.
If you are searching for Qbasic commands for class 6 or Qbasic statements for class 7, then this is the right article for you.
Here in this post, we will learn about basic commands and statements that will help you to understand the concept of how a computer understands what you have programmed.
If you want to know about Qbasic check QBASIC Programming – Beginner’s Friendly
QBasic commands are available as an external command in the following version of Microsoft Operating Systems:
- All Versions of MS-DOS
- Windows 95 and
- Windows 98
However, the modern operating system(Windows 10, 11) doesn’t have these external commands built-in. To use the qbasic commands you need to install QBasic in windows first.
Here in this article, we will talk about both External QBasic commands and QBasic statements.
First, let us understand what are external and internal commands and Qbasic Statements.
What are External and Internal Commands?
External commands are those commands which are not in-built in MS-DOS or Windows. To read those external files we need an internal file that can interpret those commands. In a modern-day operating system, the QBasic commands are not in-built so those QBasic commands are external commands. We need to install QBasic on our computer system that will then interpret those External Commands.
However, internal commands are those commands that are in-built commands in your operating system like windows. There is no need for any external software or files to interpret those commands.
The internal commands are the same in every windows version. Examples of Internal commands are del, mkdir, copy, cls, date, ren, vol etc. you can get all the commands by typing HELP in the command prompt in windows.
All versions of MS-DOS and Windows have the same internal commands but may have different external commands.
What is a QBASIC statement/command?
A command or instructions in a QBASIC is called a statement. Some are executable commands while some are non-executable commands. Executable statements are those that have a specific action while non-executable are the ones which is used to specify arguments, initial value or provide characteristics to a data
Since we now know the meaning of external commands, let us see some of the External QBASIC Commands.
List of External QBASIC commands
First, start the MS-DOS QBasic environment.
|/B||It allows us to use a monochrome monitor with a color graphics card.|
|/EDITOR||It starts the MS-DOS editor|
|/G||Provides the fastest update of the CGA screen (works only with machines using CGA monitors). If you see some dot flickering on your screen that means your hardware cannot fully support this option.|
|/H||display the maximum number of lines on your screen.|
|/MBF||It converts IEEE numbers to Microsoft-Binary-Format numbers.|
|/NOHI||This command allows us to use a monitor that does not support high Intensity.|
|/RUN||To execute a QBASIC program. Syntax – [[drive:][path]filename].|
List of QBasic Programming Statements
Here are some of the basic QBASIC statements listed with syntax and examples.
If it is a variable or a number,
PRINT age / PRINT 30
If it is a string,
PRINT “This is a Print command”
INPUT command is used to take data from a user. It can accept both strings and numbers.
If the input data is a number then the variable name is written directly after the INPUT command.
Syntax: INPUT [“string”] variable
And if the input data is a string then the variable name in which it is to be stored is written after INPUT command followed by $sign
CLS means clear screen. This command is used to clear the screen if there are some output or results on your screen that you want to clear or erase.
LET command is used to assign a value to a variable. The value can be a string or number.
Syntax: LET [variable] = [expression]
LET name = “john” or LET age = 12
END command is used to terminate a QBasic program. This statement is written at the end of a program to let the computer know that it is the end of the program and to terminate the process.
REM is a remark command. This is a non-executable statement. It is written within a single quote.
LINE INPUT statement
LINE INPUT statement allows to input data at a time and assign it to a single variable.
Syntax: LINE INPUT “string”; string variable
LINE INPUT “please enter the data”; n$
So these are some of the basic Qbasic commands and Qbasic statements that will help you to get started with the programming language.