Subject Re: [firebird-support] Re: UDF and Linux, Need help....
Author Trond
On Fri, 13 Feb 2004 08:31:55 -0000, Svein Erling
<svein.erling.tysvaer@...> wrote:

> Hei Trond!
>
> I have no knowledge about neither UDFs nor Linux, but your code has
> one flaw:
>
>> if prefix > 0 then pre := (inttostr(prefix)[1]);
>> begin
>> formatertNR[1] := pre;
>> end;
Yes, this is stupid and dangerous. Thanks. I must have been really
frustrated when I wrote this.
>
> I think that should be
>
> if prefix > 0 then
> begin
> pre := (inttostr(prefix)[1]);
> formatertNR[1] := pre;
> end;

Or if prefix > 0 then formatertNR[1] := inttostr(prefix)[1];


>
> since 'pre' otherwise would not get a value if prefix <= 0.
>
> Also, I find
>> formatertNR := trim(inttostr(V1));
> to be a bit funny...
I like to blame "Cut and Paste" for this one :).
>
> I hope this helps, even though I'd expect it to be something different
> that is actually causing you problems,
> Set
> - I support Firebird, I am a FirebirdSQL Foundation member.
> - Join today at http://www.firebirdsql.org/ff/foundation
>
> Thanks again. Your mail inspired me to do a much needed cleanup in the
> rest of the code.
But, the problem is still there. From ISQL, direct connection I get a
memorysegment error.
From ISQL Localhost and my application I just loose the connection. BUT if
I run the same SQL from
IBExpert it works fine !! Figure that out....