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...


Can Redim be used to declare a new array ?

Answers were Sorted based on User's Feedback



Can Redim be used to declare a new array ?..

Answer / m.chitramala

No We can't use redim to declare a new array. Redim is used
to resize the declared array

Is This Answer Correct ?    35 Yes 3 No

Can Redim be used to declare a new array ?..

Answer / padma

M. chitramala is right. Redim is to resize the exiting
array variable.

sample:
Dim myarray() as string

Redim myarray(10)

Is This Answer Correct ?    14 Yes 1 No

Can Redim be used to declare a new array ?..

Answer / pradeepa v

Redim is used to increase the dimension/size of the array.
Preserve keyword is used to hold the previous value of the
array.

ex: Redim Preserve a[20]

Is This Answer Correct ?    11 Yes 1 No

Can Redim be used to declare a new array ?..

Answer / shetty

redim can only be used to increase/decrease the size of the
existing array.it cannot be used to create a new array.

srinivas shetty

Is This Answer Correct ?    4 Yes 0 No

Can Redim be used to declare a new array ?..

Answer / ashok s bhosale

Redim can be Used Create New array of different length
eg
Dim arr() As Integer
ReDim arr(3)
arr(0) = 1
arr(1) = 2
arr(2) = 3

MsgBox arr(0) & ":" & arr(1) & ":" & arr(2)
'It Print 1,2,3

ReDim arr(4)

MsgBox arr(0) & ":" & arr(1) & ":" & arr(2) & ":" & arr(3)

it display 0,0,0,0
it reinitilize all element to 0 it means it create new Array

Is This Answer Correct ?    4 Yes 0 No

Can Redim be used to declare a new array ?..

Answer / abdul khadeer

We can reinitialize the array by using REDIM but the
condition is before data, what ever the array is having
that is going to be deleted or reinitialized to zero.

So there is one solution for this:

For Example We can use the "Preserve" keyword with the
redim to reintialize the Array with old values still exists.

Is This Answer Correct ?    4 Yes 0 No

Can Redim be used to declare a new array ?..

Answer / prasad

yes friends its right redim is used to resize the decalred
array realier in the program

Is This Answer Correct ?    3 Yes 0 No

Can Redim be used to declare a new array ?..

Answer / kumari santosh

Yes, Using Redim statement the size is set at runtime.

Is This Answer Correct ?    3 Yes 0 No

Can Redim be used to declare a new array ?..

Answer / kapil

Yes Redim Can be used to create a new array.
There is no need of the dim statement before using ReDim.


Following Code works :

Redim a(5) as int

a(0) = 3
debug.print a(0)

Is This Answer Correct ?    3 Yes 0 No

Can Redim be used to declare a new array ?..

Answer / sb

if I redim an array and increase its size. will the
existing elements in the array be lost?

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Visual Basic Interview Questions

Why doesn't "my string" & Chr$(13) do what I want?

0 Answers  


Describe Database Connection pooling relative to MTS ?

1 Answers  


What is the maximum size of form to hold the controls?

3 Answers   Tech Mahindra,


what is Option Implicit

12 Answers   Cognizant, Primus Global,


How many MDI(multiple document interface) forms can include in one project(especially in visual basic)?

6 Answers   Satyam, VSS,


What is ado data control in vb6 0?

0 Answers  


Explain Get, Let, Set Properties?

5 Answers  


Types of cursors in DAO?

0 Answers  


What is the use of command Object?

2 Answers  


How to use advanced data-bound controls.

0 Answers  


what are the types of combo box?

1 Answers   Satyam,


What is the diff between the Create Object and Get object?

2 Answers  


Categories