Developer

Save time with VB6's Definition command

When you're working on a big project, it's easy to get bogged down and spend a lot of time looking at code. Check out how you can use VB6's Definition command to minimize how much time you have to pour over a variable declaration, a procedure's code, and so on.

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!

Editor's Picks

Free Newsletters, In your Inbox