When to use Code VB tools
This page gives an overview of the moments you will be using Code VB tools. The presentation follows the flow of the Code VB menu which is added to the Visual Development Environment.
Declare procedures, variables and constants
- Create new procedure
- Add class properties
- Add variables or procedure arguments
- Add a constant and select some value for it - filename, fieldname,...
Class and collection
- Create and use custom classes
- Add properties easily
- Use the built-in collection class: Add and Remove items, For Each
- Use With and automatically have the relevant variable selected for it
- Many uses of message box with the appropriate Select Case statements automatically added
- InputBox extensions with code to validate if the value is of correct type
- File selection Open and Save
- Add error handler code and error handling module
- Add line numbers to help determin where in a procedure an error occurs
- Insert Debug statements
In your code you will use names of objects regularly. The Name submenu provides easy access to many names without having to remember them or spend time looking them up or having to guess with the risk of making errors or typos.
When writing a program you use both built-in and custom - written by you - procedures. These again can be inserted using the Code VB menu. Code VB attempts to use variables already available in you procedure to fill in the arguments. Under Preferences you can customize the way procedures get inserted. As an example, you can set if you want to have explicit arguments used in the procedure call.
The built-in VB procedures contain many useful functions. These have been organized in the menu so that they are easy to find:
- Current Project lists all procedures you defined in your project
- Strings shows all string handing procedures. Below Strings the menu Format displays all types of formatting such as FormatDate.
- Arrays gives you procedures used to working with arrays.
Add Fragments of code
The concept of managing a libary of code fragments or snippets is far from new. What is new is that fragments are fully merged in the menu system alongside the built-in vb code which makes it natural to chose built-in code or your own code fragments.
Reference and Tutorials, Custom Search
Admitted, we programmers spend a lot of time looking for sample code and explanations. The MSDN Office library is the most extensive resource. We sprinkled the menu with jumps to the relevant pages. In addition, you can use our Google based custom search which gives priority to selected on-line resources concerning VB.
- Comment lines
- Print VB code as HTML