Subject | Re: [firebird-support] Need help writing a UDF... |
---|---|
Author | Ivan Prenosil |
Post date | 2005-05-23T12:37:48Z |
>>>function Distance(var lon1, lon2, lat1, lat2: real): real; cdecl;But perhaps in some future Firebird versions NULL value
>>
>> Kill 'var'. You've declared the UDF as receiving arguments by
>> value, not by reference.
>
> I think 'var' is correct, input parameters are always passed by reference.
will be passed as null pointer, so better use
function Distance(lon1, lon2, lat1, lat2: PDouble): Double; cdecl;
...
if Assigned(lon1) then ...
Ivan