Subject Baffled by UDF results
Author Peter
I am experiencing some odd results with UDFs (FB1.5 + D7 on XP).

Example: Where input values are zero Cast(V1+V2+V3 As Numeric(18,4)) predictably results in zero (or correct figure where values higher than zero are entered). But a UDF "Total(var V1,V2,V3: currency): currency" which simple adds and returns the value does not give the correct result. Using a message box to verify UDF figures it shows the input values, in this example, as zero and the value to be returned as zero as you would expect. The odd part is when the table is updated the field shows a value of around 7598834810722.7136, but if I edit out the UDF and replace it with the cast option the field shows the expected value which would suggest the UDF did not actual return zero. Can someone put me straight?



Thanks in Advance

Peter


[Non-text portions of this message have been removed]