i suggest two other methods.

Method 4, arraySize is multiplied by 2 when arrayIndex exceeds arraySize.
 Code:
Dim $arraySize	$arraySize=256	; minimum value must be 1
Dim $array[$arraySize]
Dim $arrayIndex	$arrayIndex = -1

For Each $E in $list
	$arrayIndex = $arrayIndex + 1
	if $arrayIndex > $arraySize
		$arraySize = $arraySize * 2
		redim preserve $array[$arraySize]
	endif

	$array[$arrayIndex]=$E
Next

if $arrayIndex=-1
	; empty array
	$array = nothing
else
	redim preserve $array[$arrayIndex]
endif


Method 5, arraySize is incremented with arrayInc when arrayIndex exceeds arraySize.
 Code:
Dim $arrayInc	$arrayInc=256		; minimum value must be 1
Dim $arraySize	$arraySize=$arrayInc
Dim $array[$arraySize]
Dim $arrayIndex	$arrayIndex = -1

For Each $E in $list
	$arrayIndex = $arrayIndex + 1
	if $arrayIndex > $arraySize
		$arraySize = $arraySize +$arrayInc
		redim preserve $array[$arraySize]
	endif

	$array[$arrayIndex]=$E
Next

if $arrayIndex=-1
	; empty array
	$array = nothing
else
	redim preserve $array[$arrayIndex]
endif


Christophe
(sorry for my english)
_________________________
Christophe