Basic Language System Commands

Continuation from "More on understanding basic language

SOME SYSTEM COMMANDS

 These commands are used without line numbers. They are executed as soon as we press the Enter Key. They are also called direct mode commands.

1. REM: REM is a short form of Remark; It is used to give heading for the program. It is a non-executable command. REM command can be given anywhere in the program.

SYNTAX
LineNo REM Comment

E.g.
10 REM This is a program for print 2 numbers
20 PRINT 5, 6
30 REM Now we can add the numbers
40 PRINT 5 + 6
50 END
RUN

OUTPUT
5      6
11
OK

2. CLS: CLS is a command used for clearing the screen. This command wipes out whatever is displayed on the monitor.

SYNTAX
CLS

E.g.
10 PRINT 4
20 PRINT 8
30 PRINT “JOHN”
40 END
RUN

OUTPUT
4
8
JOHN
OK
CLS
After CLS Command, the screen becomes clear of all data.

3. RUN: RUN Command tells your computer to read the program instructions and execute them. To execute RUN command, press the function key F2.

SYNTAX
RUN

E.g.
10 PRINT “LET”
20 PRINT “US”
30 PRINT “GO”
40 END
RUN
OK

OUTPUT
LET
US
GO

4. LIST: LIST command lists out all the instructions stored in the computer’s memory. It arranges a program in the ascending order and displays all the instructions. To execute RUN command, press the function key F1.

SYNTAX
LIST LineNo

E.g.
10 PRINT “WILLIAM”
20 PRINT “BERNAD”
15 PRINT “SHAKESPEARE”
25 PRINT “SHAW”
LIST

OUTPUT
10 PRINT “WILLIAM”
15 PRINT “SHAKESPEARE”
20 PRINT “BERNAD”
25 PRINT “SHAW”

5. NEW à New command wipes the old program from the computer’s memory. It is food practice to type NEW and press ENTER key before starting a NEW program.

SYNTAX
NEW

6. DELETE: As the name indicates, this command is used to remove any unwanted line from your program.
SYNTAX
DELETE

E.g.
10 PRINT 5
20 PRINT 3
30 PRINT 10
40 END
         
One line can be removed by typing DELETE 20.
Line no 20 will be removed from the memory.
Now LIST command should be used to view the program
10 PRINT 5
30 PRINT 10
40 END

POINTS TO REMEMBER


1. REM or REMARK statement is used as the heading of the title of the program
2. CLS command is used to clear the screen.
3. NEW command clears the program form the memory of the computer.
4. DELETE command is used to remove any line from the program.
5. RUN command executes the program.


No comments: