If you right-click in the VB6 code-editing window, you’ll
see a pop-up menu with various commands. One of the most useful commands is
Definition, particularly when you are working on a large and complex project.
This command is a terrific time saver when you need to look at a variable
declaration, a procedure’s code, and so on.
The way this command works depends on the type of code
element. For instance:
- If you
click on a variable name, you go to the place where the variable is
declared (the Dim statement). - If you
click on a symbolic constant name, you go to the location where the
constant is defined (the Const statement). - If you
click on a procedure name, you go to the procedure definition. - If you
click on a class name, you go to the class definition. - If you
click on a member of an intrinsic element, such as control property or
method, you go to the entry for that item in the Object Browser.
However, if the editing cursor is already on the code
element of interest, you can select View | Definition or press [Shift][F2] for the same result. Then when you are done, select
Last Position from the pop-up or View menu, or press [Ctrl][Shift][F2]
to return to where you were initially in the code.
Advance your scripting skills to the next level with TechRepublic’s free Visual Basic newsletter, delivered each Friday. Automatically sign up today!