Subject Re: [IBO] UDF Parameter Bug in IBO ????
Author Helmut Steinberger
Helen,

yes, I tested it with both, the oldparameterordering = 0 and
oldparameterordering = 1.

With both settings the same result.

Could you test it with my enclosed testudf?

The Pascal Code of the UDF :

function test_udf (var intparam : integer;
var intparam2 : integer;
var doubleparam : double) : double; stdcall;

begin
doubleparam := (doubleparam + intparam + intparam2) / 2;
result := doubleparam;
end;

The UDF is declared to FB like that:

DECLARE EXTERNAL FUNCTION TEST_UDF
integer,
integer,
double precision
RETURNS double precision BY VALUE
ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^

Then set up an ib_query or ib_cursor and set the sql.text of it to
select test_udf (:a, :b, :c) from rdb$database

Then set

ib_query.parambyname ('a').asinteger := 1;
ib_query.parambyname ('b').asinteger := 2;

until here it works.

But if you try to set
ib_query.parambyname ('c').asfloat := 2.9;
you will get an exception: 2.9 is not a valid integer value.

Please try it.

cu
Helmut