Could someone clearly explain what is Redim & Redim Preserve, what are they used for and why they are used?
------------------
OmarSwan
[email protected]
http://www.omarswan.cjb.net
To God Be The Glory
Printable View
Could someone clearly explain what is Redim & Redim Preserve, what are they used for and why they are used?
------------------
OmarSwan
[email protected]
http://www.omarswan.cjb.net
To God Be The Glory
Roughly, you use redim when you are setting the dimensions of an array. You use Redim Preserve when you have declared it and put values in and need to change the dimensions without losing hte data.:
dim strTemp() as string - dims the array variable
redim strTemp(2) - sets the dimensions of hte array
strtemp(1) = "Test1"
strtemp(2) = "Test2"
redim preserve strTemp(3)
strtemp (3) = "test3"
Hope that helps