recently, i checked a script and founded not optimized code. I decided to make little changes and script started to fail. Here is an example :
 Code:
"---------------------------" ?
" kix version : " @KIX ?
"---------------------------" ?

dim $arr, $t1, $t2, $t3, $t4, $t5

$line = "field 0;field 1;field 2;field 3"

"- not good programming but works" ?
$t1 = split( $line, ";" )[0]
$t2 = split( $line, ";" )[1]
$t3 = split( $line, ";" )[2]
$t4 = split( $line, ";" )[3]
$t5 = split( $line, ";" )[4]


"- good programming but doesn't work !!!" ?
$arr = split( $line, ";" )
$t1 = $arr[0]
$t2 = $arr[1]
$t3 = $arr[2]
$t4 = $arr[3]
$t5 = $arr[4]
First part is OK, second part generates an error "ERROR : array reference out of bounds!"

I decide to test a new version :
 Code:
"---------------------------" ?
" kix version : " @KIX ?
"---------------------------" ?

dim $arr, $t1, $t2, $t3, $t4, $t5

$line = "field 0;field 1;field 2;field 3"

"- not good programming but works" ?
$t1 = mysplit( $line, ";" )[0]
$t2 = mysplit( $line, ";" )[1]
$t3 = mysplit( $line, ";" )[2]
$t4 = mysplit( $line, ";" )[3]
$t5 = mysplit( $line, ";" )[4]


"- good programming but doesn't work !!!" ?
$arr = split( $line, ";" )
$t1 = $arr[0]
$t2 = $arr[1]
$t3 = $arr[2]
$t4 = $arr[3]
$t5 = $arr[4]

function mysplit( $str, $sep )
	$mysplit = split( $str, $sep )
endfunction
Exactly the same problem. Wrong code is working and "good" code is not working (good code should test index with UBound)

I just write kix version at the begining because i test with 4.53 and 4.60 to 4.64. All versions have the same problem.

Ruud,

this is dangerous to change something now because many scripts could fail suddenly but have you already seen this problem ?
_________________________
Christophe