Subject | Re: [firebird-support] Re: UDF and Linux, Need help.... |
---|---|
Author | Trond |
Post date | 2004-02-13T13:58:40Z |
On Fri, 13 Feb 2004 14:17:33 +0100, Ivan Prenosil
<Ivan.Prenosil@...> wrote:
problem.
I'v struggled with this before (Returning a Pchar). what is it that I am
supposed to
allocate, the result variable?. A small examle will be greatly apriciated.
Or maybe I try to write a StoredProc instead, but it has worked for over a
year on windows servers.
Thank you for your patient.
Trond.
Trond
<Ivan.Prenosil@...> wrote:
>> But, the problem is still there.No, I'm sorry, but I don't know how to do this. I can see that this is a
>
> Do you mean the problem is still there even after correcting
> memory allocation in the way I told you in previous mail ?
>
>> function kidfromint(var V1, prefix,lengde : integer) : PAnsichar;
>> cdecl; export;
>> var
>> formatertNR : string;
>> begin
>> formatertNR := trim(inttostr(V1));
>> ...
>> Result := PAnsichar(formatertNR);
>> end;
>
> You are returning address of long string associated with local
> variable, that is freed after the function ends, i.e. _before_ Firbird
> reads its value.
>
> Ivan
>
problem.
I'v struggled with this before (Returning a Pchar). what is it that I am
supposed to
allocate, the result variable?. A small examle will be greatly apriciated.
Or maybe I try to write a StoredProc instead, but it has worked for over a
year on windows servers.
Thank you for your patient.
Trond.
>--
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
Trond