The second part of the code is working as expected - you fill an array from Split, and it has a specific number of elements (as can be shown by UBound, and would be 3 in this case). If you ask for element 4 in a 3-element array, you'll get the above error.

The Split(X, d)[n] format performs a split, and the [n] asks for the n'th element. You aren't directly accessing the array, so the out of bounds error doesn't display. It probably should, though. As such, instead of an error, you get an empty value. You're right - this is bad coding! ;\)

If you expect 5 elements returned from a split, try this:
 Code:
$line = "field 0;field 1;field 2;field 3"
$aTmp = Split($Line + ';;;;', ';') ; insure 5 elements in array
$t1 = $aTmp [0]
$t2 = $aTmp [1]
$t3 = $aTmp [2]
$t4 = $aTmp [3]
$t5 = $aTmp [4]
Glenn
_________________________
Actually I am a Rocket Scientist! \:D