Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between Dim And Redim

Answer Posted / deepa

Dim Statement

Declares variables and allocates storage space.

Dim varname[([subscripts])][, varname[([subscripts])]] . . .

Variables declared with Dim at the script level are
available to all procedures within the script. At the
procedure level, variables are available only within the
procedure.

You can also use the Dim statement with empty parentheses
to declare a dynamic array. After declaring a dynamic
array, use the ReDim statement within a procedure to define
the number of dimensions and elements in the array. If you
try to redeclare a dimension for an array variable whose
size was explicitly specified in a Dim statement, an error
occurs.


ReDim Statement
Declares dynamic-array variables, and allocates or
reallocates storage space at procedure level.

ReDim [Preserve] varname(subscripts) [, varname
(subscripts)] . . .

The ReDim statement is used to size or resize a dynamic
array that has already been formally declared using a
Private, Public, or Dim statement with empty parentheses
(without dimension subscripts). You can use the ReDim
statement repeatedly to change the number of elements and
dimensions in an array.

If you use the Preserve keyword, you can resize only the
last array dimension, and you can't change the number of
dimensions at all. For example, if your array has only one
dimension, you can resize that dimension because it is the
last and only dimension. However, if your array has two or
more dimensions, you can change the size of only the last
dimension and still preserve the contents of the array.

The following example shows how you can increase the size
of the last dimension of a dynamic array without erasing
any existing data contained in the array.

ReDim X(10, 10, 10)
. . .
ReDim Preserve X(10, 10, 15)
Caution If you make an array smaller than it was
originally, data in the eliminated elements is lost.

Is This Answer Correct ?    20 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I import environment from a file on disk?

1081


Explain in brief about the quicktest professional (qtp) automation object model?

988


What is the syntax for how to call one script from another?

1049


can u please explain what is the exact difference between qtp8.2 and 9.0

2168


In application which areas to be automated and what kind of situation will be take? using QTP? Plz give me the clear answer

2407


What is the keyword view and expert view in qtp?

955


Hi, is it possible for recording shortcut key during record session? The application on which I am working is web based application. This application has several shortcut key associated with menu option. I have succesfully recorded all menu option but unable to record shortcut key.

1827


how to know no.of mails in our g mail by using vb-script

2236


What do you mean by iteration?

1214


can any body tell me how i create a simple script and apply output value on it .pls send me a step by step process

1789


Is any limitation to xml checkpoints?

1027


What is quicktest professional (qtp)?

1046


what is meant by function library?Public and private functions in function library? if private functions are applicable for only for the particular test means then y we have to add those to function library?

1960


Does QTP10 supports Windows 7OS +IE 9 combination? Which is the preffered combination ,Plz let me know?

3444


wht is Manual Testing Frame work. Pls anybody can give appropriate answers

2087