You need to maintain an index of the second array and dim/redim it as needed.
Code:

dim $BadItemsArray[10]
$BIAindex=0
For Each $item in $array
;do something that produces an error code
If @Error <> 0
$BadItemsArray[$BIAindex]=$item ;Add item to bad items array
$BIAindex=$BIAindex+1 ;check UBound here to ReDim
Else
Add item to good items array
EndIf
Next


_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.