Rules for Naming a Variable
1- A Variable name cannot be more than 40 characters.
2- The name of Variable may contain alphabets (both lower case and upper case) numbers and decimal points.
3- The first character in name of Variable must be an Alphabet.
4- Key /Reserved words of BASIC cannot be used as Variables.
5- Blank space is not allowed in names of Variables.
6- Last character of variable name should indicate the type of variable.
Examples of Correct Variable Names:
c_ls
xyc
x1y1
xyz1
_xyz
_cls
c_ls
xyc
x1y1
xyz1
_xyz
_cls
Examples of Wrong Variable Names:
cls(Because rule no 4 broken)
x y c(Because rule no 5 broken)
x$y$1$(Because rule no 6 broken)
1xyz(Because rule no 3 broken)
_xyzasdasdddddddddddddddddddddddsdasda
asdasdasdasdadasdasdaasdas(Because rule no 1 broken)
cls(Because rule no 4 broken)
x y c(Because rule no 5 broken)
x$y$1$(Because rule no 6 broken)
1xyz(Because rule no 3 broken)
_xyzasdasdddddddddddddddddddddddsdasda
asdasdasdasdadasdasdaasdas(Because rule no 1 broken)
No comments:
Post a Comment