Saturday, November 24

Essential Rules for a BASIC Program

Certain words have some special meaning in BASIC. These words are known as keywords. Those keywords are used in the construction of a BASIC statement and such statements are put together to form a BASIC program. In other words, a BASIC program is composed of sequence of statements.
The following are the essential rules or conventions that are to be followed while writing a BASIC program.
1. Every statement must appear on a separate line.
2. A statement cannot exceed one line in length (i.e. a statement cannot be continued from one line to the next).
3. Each statement must begin with a positive integer quantity known as the line number or statement number

  • No two statements can have the same line numbers.
  • The range of line numbers lies between 1 to 65529 (range may vary depending on the system and interpreter or computer used).
4. Each statement may contain a maximum of 255 characters, including the ENTER character.

5. Successive statements must have increasing line number.
6. Each line number must be followed by a BASIC keyword, which indicates the type of instruction that is to be carried out.
7. Blank spaces can be inserted anywhere to increase the readability of the statement.
8. Blank lines can be inserted in a BASIC program, but each blank line must be proceed with a line number.      

No comments:

Post a Comment