in reply to Error Problem

clipcalc() is reading only the first record of the file.

You need to put that in a loop, to read the entire file.

     "How many times do I have to tell you again and again .. not to be repetitive?"