Choosing A Valid
Name For Variable
When declaring on variable, you choose its
For example:Dim Tuti As Integer
The example above will set the variable
name to be "Tuti".
The names you choose for
your variables don't have
to have any meaning, but still there are some
about the names you can call your variables.
1)The only characters that can appear in the name
letters, numbers and the character _ (the underscore
You can't use other characters like: ` ! @ # % ^
& * ( )
Therefore, the following names are NOT valid: AB!,
2)The Name Must begin with a letter: You
use the names: 2abc, 3, 2345, _aba
can't use space in the variable's name.
Therefore, the following
names are NOT valid: A B, hello world
4)You can't call your variable with
a name that is a Visual Basic
Command or Function (these
names are been called "saved names").
For example you can't
use the name Print, because there is
command in Visual Basic
that called Print (which we used pretty much
You can know easily if a name is a saved name by
typing it anywhere
in your code. All the saved names are being
painted with blue color.
Few examples for saved names:
Print, Sub, End, MsgBox
Examples for valid names:
a, A, AaAaA, aBhguKJhUJYf, abc123,
There is much more to learn about
variables, like constants,
booleans, arrays and more.
you've learnt by now is necessary for continuing
with the next
More advanced variables subjects will appear
during the next
Go to Lesson 3
to learn more about Events and