arrays...

Rookie
09-03-2003, 12:55 AM
is therre a way to resize an array without the contents being erased?

gundavarapu
09-03-2003, 01:33 AM
use preserve keyword along with redim

like

Redim Preserve MyArray(20) as string


Hope this helps!

rajeeshun
09-03-2003, 01:38 AM
is therre a way to resize an array without the contents being erased?


Ya.. .you can !!
Use redim & redim preserve


eg :


Private Sub Command1_Click()

ReDim SS(2) As Variant


SS(0) = "ONE"
SS(1) = "Two"
SS(2) = "THREE"

MsgBox SS(0) & " " & SS(1) & " " & SS(2)
ReDim Preserve SS(3)

SS(3) = "Four"
MsgBox SS(0) & " " & SS(1) & " " & SS(2) & " " & SS(3)

Rookie
09-03-2003, 02:10 AM
thanks!!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum