See Problem in my coding, which has answers to this problem
In reply to Re: Getting errors by Corion in thread Getting errors by Anonymous Monk