Subject UDF does not work
Author supertokkie
I have a function in an UDF.dll

But it gives not the correct information. Could somebody tell me what
I'm doing wrong?


library UDF;

uses
SysUtils,
Classes,
Proc in 'Proc.pas';

{$R *.res}

exports
CONVERTMULTIPACK;

begin

end.






unit Proc;

interface

function CONVERTMULTIPACK(var MultiPack: PChar): PChar; cdecl; export;

implementation

uses SysUtils, ib_util;

function CONVERTMULTIPACK(var MultiPack: PChar): PChar;
var Test: PChar;
begin
Result := IB_UTIL_malloc(3);
try
if MultiPack = ('Y') then
Result := PChar('Ja')
else
Result := PChar('Nee');
except
end;
end;


initialization
IsMultiThread := True;

end.






DECLARE EXTERNAL FUNCTION FCONVERTMULTIPACK
VARCHAR(1)
RETURNS VARCHAR(3) FREE_IT
ENTRY_POINT 'CONVERTMULTIPACK' MODULE_NAME 'UDF.dll'