Instantiation Standards

Now that you have decided on names for your variables, constants, controls, and other elements of your application, it is time to put them into active use. Instantiation is the process of adding declaration elements to your source code.

Instantiation of Variables

Because all of your modules will contain the Option Explicit statement, you are required by the Visual Basic development environment to declare every variable before use. Take care in declaring your variables, as these declarations will determine the range of values available for each variable. Declare your variables in known locations, and in a consistent manner.

Visual Basic contains six types of variable declaration: global, module, local, static, passed, and ...

Get Visual Basic® Style Guide, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.