Please fix the long lines in one of your previous posts.

The best way is to use UDFs for pretty much anything. Also, segment code into 'subroutines' that are called from a main routine via GOSUBS or UDF calls.

This will make debugging easier as you can selectively disable part of the script by just commenting out the calling line.
_________________________
There are two types of vessels, submarines and targets.