If you have added the forms and controls to the project, the visual basic language will make them work. The visual basic 6 language is the code or instructions once an event like click happens.
In VB 6 language, you must learn the following things.
- Declare variables, constants, functions and subroutines.
- Use strings, operators, conditions, loops and handle math.
- Understand how VB 6 format financial data and dates.
In this article, you will learn to declare variables and constants. We will learn rest of topics in future articles.
Variable Declaration in VB6
The coding part in VB6 starts with a variable declaration. A variable in vb6 is a name that hold a value. Visual basic 6 is a typed language, similar to C/C++, Java that supports all kinds of data types.
Dim [WithEvents] variable name [([subscripts])] [As [New] type]
The keywords inside square bracket are optional. Let us discuss each of these keywords briefly.
WithEvents – tells that varname is object variable that respond to events by an active x object. varname is name of the variable.