Subject returning floating point values from UDF
Author danyschaer
Hi,

Is that possible to write/use UDF that returns a floating point value?

How do I have to declare it with Delphi and how do I have to declare it.

For example, I tried:

// DLL:

library myudf;

uses
SysUtils,
Classes;

function UDF_tonumber(Source: PChar): extended; cdecl; export;
begin
result := 1234.28;
end;

exports
UDF_tonumber;

begin
end.

// DECLARE:

DECLARE EXTERNAL FUNCTION tonumber
CSTRING(255)
RETURNS FLOAT
ENTRY_POINT 'UDF_tonumber' MODULE_NAME 'myudf';


... but does not work. FB accepts me to declare it, but then it say

Engine Code : 335544343
Engine Message :
invalid request BLR at offset 59
function TONUMBER is not defined
module name or entrypoint could not be found

I have some string UDFs in myudf.dll and they are working very well.

Thank you very much.

Dany