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 we will discuss those basic commands and statements which 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:
However, the present-day operating system doesn’t have these external commands in Windows. To use those commands you have to install QBasic in windows first and then use it.
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.
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 in our computer which will then interpret those External QBasic Commands.
However, internal commands are those commands which are in-built windows commands. There is no need for any external files to interpret those commands. Internal commands are the same in all versions of Windows. Examples of Internal commands are del, mkdir, copy, cls, date, ren, vol etc. you can get all the commands by typing HELP in command prompt in windows.
All versions of MS-DOS and Windows have the same internal commands but may have different external commands.
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 one 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.
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].|
Here some of the basic QBASIC statements list with syntax and examples.
1) PRINT: This command/statement prints the statement or data written after it on the output screen. If you want to print a sentence or string then you have put inside double quotes (“ ”) and if you want to print a variable or a number, you can just write after the PRINT command.
If it is a variable or a number,
PRINT age / PRINT 30
If it is a string,
PRINT “This is a Print command”
2. INPUT: this command is used to take data from a user. It can accept both string and number.
If the input data is a number than the variable name in which the number is to be store 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
3.CLS: 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.
4.LET: This 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
5.END: 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.
6.REM: This is a remark command. This is a non-executable statement. It is written within a single quote.
7.LINE INPUT: This 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.
QBASIC stands for “**Quick Beginners All-Purpose Symbolic Instruction Code**”. QBASIC was developed by [Microsoft Corporation](https://en.wikipedia.org/wiki/Microsoft) in the year 1991. It is considered to be one of the most easy-to-understand programming languages for beginners.
QBasic programming examples and exercises for class 6 and class 7 standard.These Qbasic program examples are a beginner-level, which mostly will help you to understand the concept of a variable and some basic qbasic statements like PRINT, INPUT, CLS etc.