BASIC VARIABLES

There are two fundamentals in BASIC programming language. They are:
a. Variable (b) Constant

Variables

They are values of a program which charges during program executions. There are five basic variable types. These are STRING, INTEGER, LONG INTEGER, SINGLE precision and DOUBLE precision variables.

VARIABLES NAMING RULES:

There are some rules that must be strictly adhered to when we write BASIC variable names in our programs. These are:

  1. A BASIC variable name can consist of not more than 40 characters
  2. The first character in variable name must be a letter of the English alphabet.
  3. The only characters allowed in a BASIC variable name are letters, numbers, the decimal point, and the type declaration character -%, &, $, #, !. A type declaration if present must be the last character in the name.
  4. A variable name cannot be a reserved word (or keyword). For example, PRINT, READ, AND DATA are all BASIC reserved words and thus cannot be used as variable names.

Based on the above, it can easily be discovered that the following names are illegal

5vom – Starts with a number
La Jaun – Contains space character
Mangoes [p – Contains an illegal character, [
Mai & kk – & is embedded in the name
k-iller – Contains an illegal character,-
Read – Keyword cannot be used as variable

Note that the BASIC programming language is not case sensitive. Example ADA, Ada, aDA and ada are the same.

Leave a Comment

not allowed!