Home » VB 6.0 Tutorial » VB 6 Variable Declarations

VB 6 Variable Declarations

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.

  1. Declare variables, constants, functions and subroutines.
  2. Use strings, operators, conditions, loops and handle math.
  3. 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.

Syntax:

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.

(adsbygoogle = window.adsbygoogle || []).push({}); </script

Please support us by disabling your adblocker or whitelist this site from your adblocker. Thanks!

turn of adblocker imag

(adsbygoogle = window.adsbygoogle || []).push({});