Les' suggestion is definitely good, but here's a solution for your particular piece of code. I am using a counter to see how many computers I've been reading and redimensionize the array each time I'm adding a computer to the array. It is not the most effective solution because of the constant resizing but it shows you how to use the arrays.
code:
Dim $Computerlist[0], $NumberComputers
$SelectedDomain = $DomainBox.Text
shell '%comspec% /c net view /domain:$SelectedDomain | Find /i "\\" > Domain.dat'
$nul = open (2,Domain.dat,2)
$Domain = Readline(2)
$NumberComputers=0
Do
Select
Case Substr($Domain,1,12) = ""
$Nul= $Form.MsgBox("Could not find $SelectedDomain Domain", "Domain not found")
$Nul = Close(2)
Del Domain.dat
Exit
Case Substr($Domain,1,2) = "\\"
$CompListBox.Additem (Rtrim(Substr($Domain,3,)))
redim preserve $ComputerList[$NumberComputers]
$ComputerList[$NumberComputers]=(Rtrim(Substr($Domain,3,)))
$NumberComputers=$NumberComputers+1
Case 1
EndSelect
$Domain = Readline(2)
Until $Domain = ""
$Nul = Close(2)
Del Domain.dat
_________________________
There are two types of vessels, submarines and targets.