Subject | Re: FW: [ib-support] UDFs and NULL |
---|---|
Author | Doug Chamberlin |
Post date | 2001-09-17T15:28:35Z |
At 9/16/2001 12:29 PM (Sunday), Dimitar Selensky wrote:
and is on the list of enhancements being contemplated.
At 9/17/2001 08:38 AM (Monday), Gerhardus Geldenhuis wrote:
of the VarisNull function. I would NOT recommend relying of this code since
it can produce an access violation and bring down your Interbase server.
IIRC, VarIsNull is designed and intended to be used with Variants only. The
parameters to your functions are of type Integer, not Variant. Therefore,
in this case I expect the VarIsNull is playing nice and returning a default
value when it sees it is being called with an incorrect parameter.
>Is there a way to tell that a certain parameter passed to an UDF functionNo, there is no definitive way to do this. It has been requested many times
>is null?
and is on the list of enhancements being contemplated.
At 9/17/2001 08:38 AM (Monday), Gerhardus Geldenhuis wrote:
>Here is a function I use in Delphi to check for nullWhile this may seem to work correctly in some cases, it is really a mis-use
>procedure CheckVariables(var RF,WF:Integer);
>begin
> if VarIsNull(RF) then
> RF:=0;
> if VarIsNull(WF) then
> WF:=0;
>end;
of the VarisNull function. I would NOT recommend relying of this code since
it can produce an access violation and bring down your Interbase server.
IIRC, VarIsNull is designed and intended to be used with Variants only. The
parameters to your functions are of type Integer, not Variant. Therefore,
in this case I expect the VarIsNull is playing nice and returning a default
value when it sees it is being called with an incorrect parameter.