Matthew,
You don't say if this is written as a UDF or not, there is no RETURN statement in the code you posted, if there is no RETURN in the UDF Xbase will do an implicit RETURN .T. at the end of the UDF.
>I'm sure it is just because I have been working on this tooooo long. Yesterday I got the results I wanted, today I am getting a logical output instead of the number I am trying to calculate. What is the error of my ways? Using VFP6 sp5 on Win2K sp2.