Micro Focus QTP (UFT) Forums
REDIM memory allocation - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: REDIM memory allocation (/Thread-REDIM-memory-allocation)



REDIM memory allocation - Suma Parimal - 05-13-2014

Hi,

If we declare an array like - Dim Array(3) and assigned the values
Array(0) = aaa
Array(1) = bbb
Array(2) = ccc

this we can re-memorize the array by using - Redim Array(10).
In this case the previous memory as well as data will be erased rite. If i want the same array value
Array(0) = aaa
Array(1) = bbb
Array(2) = ccc to the resized array. so how can we get this.

Please Help me with vb script statment.

Regards,


RE: REDIM memory allocation - Ankur - 05-13-2014

To preserve the data, you can resize it using Preserve keyword

Code:
Redim Preserve Array(10)