Keywords are those words which have special meanings in QBASIC. Keywords are formed by using characters of QBASIC Characters Set. Keywords are statements, commands, functions (built in functions) and names of operators. The keywords are also called Reserved Words. Some reserved words and their functions are:
Keywords Functions of the keywords
LIST command is used to list the program on the screen. RUN command is used to execute the program. LLIST command is used to list of program as a hardcopy. LPRINT command is used to get the output of the program on the hard copy. NEW command is used to clear the memory of the existing program. SYSTEM command is used to take you back to dos prompt. PRINT command is used to view the display on the screen. CLS command is used to clear the screen. RME Command is used to take notes while writing a program. This is an abbreviation for remark. SYNTAX : REM notes. Anything after the REM command up to the end of the line is ignored by the Qbasic compiler. SAVE command is used to save the program. E.g. SAVE “PROGRAM1” QBasic will automatically add a period and an extension “bas” to the filename. LOAD command is used to LOAD the program from the disk to the memory. E.g. LOAD”PROGRAM1”. INPUT command is used to input any data from the keyboard. SYNTAX: INPUT < VARIABLE > E.g. Input A Input N$ Input ”Enter your name:”; a$ END command is usually given at the end of the program. DELETE command delete a line number in a program. E.g. Delete 10 will delete line number 10 Delete 30-50 will delete all line numbers between 30 to 50 SYNTAX: DELETE <LINE NO.>
Questions for practice:
A. Fill in the blanks.
1. Keywords are formed by using characters of QBASIC__________________________.
2. Keywords are also called _______________________. 3. ________________________ command delete a line number in a program. 4. ________________________ command is used to input any data from the keyboard. 5. ________________________ command is usually given at the end of the program. 6. ____________________________ is the extension of QBASIC file. 7. ____________________________ command is used to LOAD the program from the disk to the memory. 8. Anything after the ___________________________command up to the end of the line is ignored by the QBASIC compiler. 9. ___________________________ command is used to execute the QBASIC program. 10. __________________________ command is used to take you back to dos prompt. 11. __________________________ command is used to clear the memory of the existing program. 12. _______________________ command is used to get the output of the program on the hard copy. 13. ________________________ command is used to list of program as a hardcopy. 14. ________________________ command is used to list the program on the screen. 15. ___________________________ command is used to view the display on the screen.