Can Redim be used to declare a new array ?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Answer / kumari santosh
Yes, Using Redim statement the size is set at runtime.
| Is This Answer Correct ? | 3 Yes | 0 No |
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 |
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 |
What is the difference between change event in normal combobox and dbcombobox?
Explain Get, Let, Set Properties.
What is the use of OLE?
How do I mimic a toggle button?
___ property used to add a menus at runtime.
by writing MACRO CODE,i want to retrive data from one spead sheet to another UI (workbook). control will search cell by cell for each row and load the data in another workbook(UI). ex: custdetails custname lastname locaton mobile pincode custdetails raj tony hyd 555555 521245 servcreqrd srvce# srvcename location srvcepincode servcreqrd 754 drilling hyd 521784 for the above example in the another workbook retrive data like this custname Raj srvce# 754 srvcepincode 521784. while retrieving data control will search cell by cell for each row.
What is the use of Visual Basic Document file?
Clear property is available in ____,___ control.
What is ODBC?
Explain about manipulating the recordset object
How many system controls are available ?
What is the use of Visual Basic Document file?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)