Q: I use one array to put data into another array, is there a way
to completely empty the first array without having to close the program to
clear it.I want to preserve the data use it then clear it to use it again.
I can do it but I have to exit the program
There must be a way to put in code to empty the array.
Paul Norrish pnorrish@direct.ca
A: you have one array with data,
put the value's into another array and want
to empty the first array without closing the program?
If that's what you want you must use the REDIM statement...
Look at the next code; put it on a new form in the load event and run
it.
Dim t%
Dim Array1() As String
Dim Array2() As String
'fill first array
ReDim Array1(5)
For t% = 0 To 5
Array1(t%) = CStr(t%) & "x"
Next t%
For t% = 0 To 5
MsgBox Array1(t%)
Next t%
'fill second array
ReDim Array2(5)
For t% = 0 To 5
Array2(t%) = Array1(t%) & "yyy"
Next t%
For t% = 0 To 5
MsgBox Array2(t%)
Next t%
'empty first array
ReDim Array1(5)
For t% = 0 To 5
MsgBox Array1(t%)
Next t%
Return