Best Coding Practices Visual Basic 6

It is up to you to follow following practices. Avoid magic numbers when you can: These are numbers which are hardcoded in your program. Be modular: Putting code and data together into modules hides it from the rest of the program, makes it easier to debug, makes it easier to work with conceptually and even makes load time of procedures […]

Code Commenting Conventions in Visual Basic 6

While programming comments are very useful. As these help the current development and the future development of the program. Comments should provide the clear picture of procedure or variable declaration. A comment should have following sections for procedure  Section Heading  Comment Description  Purpose  What the procedure does  Assumptions  List of each external variable, control, open file, or another element that […]

Visual Basic 6 Programming Conventions

The conventions are very handy while working in a team. So following are the prefixes of various types used to declare a variable name so that its properties can be identified easily. Variable Prefixes: Variable scope prefix conventions.These must be first in the name of variable.  Scope  Prefix  Global  g  Module-level or form-level  m  Local to procedure  None Variable Prefixes […]

Types of Scope in Visual Basic 6 Project.

An object’s scope means its visibility to other classes, module, procedure etc. There are two types of scope in Visual Basic projects: variable scope and procedure scope. Variable Scope : There are three levels of variable scope in Visual Basic: at the procedure level, at the form or module level, and at the global level. Visual Basic declaring statements:   Keyword […]

The Parts of A Visual Basic 6 Project

Projects can become quite advanced in Visual Basic, even containing sub-projects of different types. From a programming point of view, however, standard Visual Basic projects usually contain just three types of items: global items, forms, and modules. Forms: They are the templates you base windows on. Besides standard forms, Visual Basic also supports Multiple Document Interface (MDI) forms, as well as […]

Types of Variables in Visual Basic 6

The possible variable types and their ranges :   Variable type Bytes of Storage Range Boolean 1 True or False Byte 1 0 to 255 Currency 8 -922,337,203,685,477.5808 to 922,337,203,685,477.5807 Date 8 1 January 100 to 31 December 9999 and times from 0:00:00 to 23:59:59 Decimal 12 -79,228,162,514,264,337,593,543,950,335 to 79,228,162,514,264,337,593,543,950,335 Double 8 -1.79769313486232E08 to 4.94065645841247E-324 for negative values and from […]