Subject | Re: Delphi UDF with PChar |
---|---|
Author | yaedos2000 |
Post date | 2006-02-16T13:20:03Z |
Hi, thanks for your help. I've tried using IBAlloc, but I'm getting
the same problems as with StrAlloc. It works fine when run in Delphi,
but when run as a UDF it just outputs a few random characters. Any
idea what might be going wrong? :-)
Thanks
<simon.carter@...> wrote:
the same problems as with StrAlloc. It works fine when run in Delphi,
but when run as a UDF it just outputs a few random characters. Any
idea what might be going wrong? :-)
Thanks
> Shouldn't you use IBMalloc (or similar name) function to allocatememory
> instead of StrAlloc?--- In firebird-support@yahoogroups.com, "Si Carter"
<simon.carter@...> wrote:
>memory
> > -----Original Message-----
> > I'm having trouble writing a UDF in Delphi that returns a
> > PChar. This is a simple example of what I'm trying to do:
> >
> > function test(InputString: PChar): PChar; begin
> > result := StrAlloc(Length(InputString));
> > StrCopy(result, InputString);
> > // Presumably the StrAlloc will be freed by the UDF's FREE IT???
> > end;
>
> Shouldn't you use IBMalloc (or similar name) function to allocate
> instead of StrAlloc?