Sams Teach Yourself Visual Basic 6 in 24 Hours

Sams Teach Yourself Visual Basic 6 in 24 Hours

By Greg Perry

Naming Objects

As you create applications and add to them objects such as forms and modules, you'll have to come up with lots of names so that both you and Visual Basic can distinguish between the objects. Unlike filenames, a Visual Basic object name must begin with an alphabetic character and can contain letters and numbers, but it cannot contain periods or several other special characters. You can mix uppercase and lowercase as much as you want. The illegal period is the primary reason why internal object names differ from filenames.

Generally, as stated previously, programmers prefix a name with letters representing the kind of object they are naming. The prefix is often stated in lowercase letters and the rest of the name often appears as a combination of uppercase and lowercase letters. Notice that the programmer did not precede the Module1 VB name file with mdl or mod, or give the module a more appropriate internal name such as ModInterestCalc, but that doing so would better describe the file's module type.

Share ThisShare This

Informit Network