Declaration of Variables, procedure arguments and Constants
An introduction to the use of variable can be found here: Declaring Variables. Below it is shown how you can save time by using Code VB to declare variables and constants.
Declaring Variables using Code VB
|Alt-CDV | Menu: Code VB » Declare » Variable|
Adding variable using Code VB makes coding faster - click this to see it in action.
As demonstrated, you can use declare variable for
- Inserting individual variable lines
- Adding multiple variables on one line
- Adding arguments to a procedure
The prefix inserted at the location where you will name the variable follows the VB naming conventions which is considered good practice. A benefit of following the prefix conventions is that it allows you to use variables without having to type the complete name by using the VDE intellisense feature. To get intellisense popup, type the prefix and next Ctl-[space]. Click this to see how intellisense displays variables in your code that have the prefix you typed.
Declaring Constants using Code VB
|Alt-CDC | Menu: Code VB » Declare » Constant|
I a similar way constants may be added. Constants are often used for filepaths and object names, so a logical next step is to insert the constant value using the Name insertion feature