Posted by: wasaa | June 22, 2008

Arrays

 

 

A group of items (String,Numbers,Dates,image, etc.) arranged in rows and columns is called an Array

Arrays allow you to refer to a series of variables by the same name and to use a number (an index) to tell them apart. Visual Basic allocates space for each index number and avoids declaring an array larger than necessary

All the elements in an array have the same data type.

But when the data type is Variant, the individual elements may contain different kinds of data (objects, strings, numbers, and so on).

There are two types of arrays in Visual Basic

Fixed-size array which always remains the same size,

2.Dynamic array: size can be changed at run- time

Declaring Fix size arrays

There are three ways to declare a fixed-size array; depending on the scope you want the array to have:

Public

array,

Use the Public statement in the Declarations section of a module to declare the array.

Module-level array

Use the Private statement in the Declarations section of a module to declare the array.

Local array,

Use the Dim statement in a procedure to declare the array.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: