Subject [firebird-support] firebird freepascal udf
Author Codebue Fabio - P-Soft
This is my UDF source

library pudf;
{$mode objfpc}{$H+}
uses
Classes;

function pround(var valore: real; ndec: integer):real;export;
var
i: integer;
risultato: real;
ndivisore: integer;
begin
risultato:= valore;
ndivisore:= 1;
for i:= 1 to ndec do
begin
risultato:= risultato*10;
ndivisore:= ndivisore*10;
end;
result:= round(risultato)/ndivisore;
end;

exports
pround name 'pround';

begin
end.

but after insert into my fdb with instruction

DECLARE EXTERNAL FUNCTION pround
DOUBLE PRECISION, INTEGER
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'pround' MODULE_NAME 'pudf';

if I use it with an instruction like this

select round(123.1233, 2) as nrounded from rdb$database

I have back this error

Invalid token.
invalid request BLR at offset 59.
function PROUND is not defined.
module name or entrypoint could not be found.

do you have some idea regarding this error?

Codebue Fabio