Hi,
This little script illustrates the problem.
In my script I need to use the dir command after the array declaration.

Regards, Christophe.

$path="C:\"

;count the number of files in the dir
$c = 0
$f = Dir("$path\*.txt")
While @error = 0
$c = $c + 1
$f = Dir()
Loop

;declare the array
Global $array[$c,1]

;check the array size
? "-1-"
? Ubound($array,1)
? Ubound($array,2)

;check insert into array
$array[0,0]="test"

;this is the command that screws up my array !
$FileName = Dir("$path\*.txt")

;Check the array size (at execution dimension 2 size is wrong)
? "-2-"
? Ubound($array,1)
? Ubound($array,2)

;Check insert into array (at execution time I have an out of bound error)
$array[0,0]="test"

[ 30. May 2003, 22:20: Message edited by: Christophe- ]