Subject udf firebird delphi
Author Marc Collin
hi

i created this function:

function MixStr(Str:PChar):PChar;
var
i, j : Integer;
c1 : Char;
begin
if (Str = nil) then
result := nil
else
begin
for i:=Length(Str) downto 1 do
begin
j:=Random(i)+1;
c1:=Str[i];
Str[i]:=Str[j];
Str[j]:=c1;
end;
result := Str;
end;
end;

under firebirdi declared:

Declare external function f_MixStr cstring(64)
returns cstring(64) free_it
entry_point 'MixStr' module_name 'brudflib2.dll';


if i do:
select f_MixStr('allo') from rdb$database

i get:

(

( and many space....

i tried with:

Declare external function f_MixStr cstring(64)
returns cstring(64)
entry_point 'MixStr' module_name 'brudflib2.dll';

but i get the same result

surely a problem with cstring, pchar...