Thanks Jens.

I'd actually updated the script to reference Array[x], but it seems my problem actually lay with the input file having blank lines in it - this was causing the routine to stop when the script referenced the array values that didn't exist.

Do you know of any way to remove "white space" in Kix - any UDF's about?

(not quite so confused any more!)