Hi Again,<br>try to copy ib_util.dll to system folder, or make PATH to Firebird bin folder.<br><br>and<br> (var valore: Double<br>not "real"<br><br><div class="gmail_quote">On Thu, Mar 13, 2008 at 12:44 PM, zaher dirkey <<a href="mailto:parmaja@gmail.com">parmaja@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">try to add "cdecl"<br><br>| function pround(var valore: real; ndec: integer):real; cdecl; export;<div>
<div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">On Thu, Mar 13, 2008 at 11:43 AM, Codebue Fabio - P-Soft <<a href="mailto:f.codebue@p-soft.biz" target="_blank">f.codebue@p-soft.biz</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I try with pudf.dll module name, I try to change function name ... I try a<br>
lot of things...<br>
sigh a so stupid UDF, and I can't create it...<br>
<br>
mmm<br>
<br>
I'm using firebird 2.0.3 in windows vista environment. pudf was compiled<br>
with fpc 2.0.4 and created with lazarus 0.9.22<br>
<br>
sigh!<br>
<div><br>
<br>
Codebue Fabio<br>
.-----------------------------.<br>
_ \ __| _||<br>
__/____|\__ \ _ \ _| _|<br>
_| ____/\___/_| \__|<br>
<br>
P-Soft di Codebue Fabio & C. sas<br>
via B.Storti, 19<br>
24060 - Chiuduno - BG<br>
Italy<br>
Phone: +39.030.839435<br>
Fax: +39.030.5100306<br>
Mobile: +39.348.3515786<br>
.-----------------------------.<br>
Web : <a href="http://www.p-soft.biz" target="_blank">www.p-soft.biz</a><br>
EMail: <a href="mailto:f.codebue@p-soft.biz" target="_blank">f.codebue@p-soft.biz</a><br>
<br>
-----Original Message-----<br>
From: <a href="mailto:fpc-pascal-bounces@lists.freepascal.org" target="_blank">fpc-pascal-bounces@lists.freepascal.org</a><br>
[mailto:<a href="mailto:fpc-pascal-bounces@lists.freepascal.org" target="_blank">fpc-pascal-bounces@lists.freepascal.org</a>] On Behalf Of Michael Van<br>
Canneyt<br>
</div><div><div></div><div>Sent: Thursday, March 13, 2008 10:24 AM<br>
To: FPC-Pascal users discussions<br>
Subject: RE: [fpc-pascal] Firebird UDF<br>
<br>
<br>
<br>
On Thu, 13 Mar 2008, Codebue Fabio - P-Soft wrote:<br>
<br>
> I create a pudf.dll library an put in UDF subdirectory of firebird<br>
> installation (where you can find other UDFs)<br>
><br>
> after this I use IBExpert to run the script<br>
><br>
> DECLARE EXTERNAL FUNCTION pround<br>
> DOUBLE PRECISION, INTEGER<br>
> RETURNS DOUBLE PRECISION BY VALUE<br>
> ENTRY_POINT 'pround' MODULE_NAME 'pudf';<br>
><br>
> it run ok, I find another udf under functions category with paremeter set<br>
> correctly<br>
<br>
This is normal; the above just inserts a record in the metadata tables;<br>
Nothing is checked. Can you try changing it to MODULE_NAME 'pudf.dll' ?<br>
<br>
Michael.<br>
<br>
><br>
> Codebue Fabio<br>
> .-----------------------------.<br>
> _ \ __| _||<br>
> __/____|\__ \ _ \ _| _|<br>
> _| ____/\___/_| \__|<br>
><br>
> P-Soft di Codebue Fabio & C. sas<br>
> via B.Storti, 19<br>
> 24060 - Chiuduno - BG<br>
> Italy<br>
> Phone: +39.030.839435<br>
> Fax: +39.030.5100306<br>
> Mobile: +39.348.3515786<br>
> .-----------------------------.<br>
> Web : <a href="http://www.p-soft.biz" target="_blank">www.p-soft.biz</a><br>
> EMail: <a href="mailto:f.codebue@p-soft.biz" target="_blank">f.codebue@p-soft.biz</a><br>
><br>
> -----Original Message-----<br>
> From: <a href="mailto:fpc-pascal-bounces@lists.freepascal.org" target="_blank">fpc-pascal-bounces@lists.freepascal.org</a><br>
> [mailto:<a href="mailto:fpc-pascal-bounces@lists.freepascal.org" target="_blank">fpc-pascal-bounces@lists.freepascal.org</a>] On Behalf Of Michael Van<br>
> Canneyt<br>
> Sent: Thursday, March 13, 2008 9:52 AM<br>
> To: <a href="mailto:f.codebue@p-soft.biz" target="_blank">f.codebue@p-soft.biz</a>; FPC-Pascal users discussions<br>
> Subject: Re: [fpc-pascal] Firebird UDF<br>
><br>
><br>
><br>
> On Thu, 13 Mar 2008, Codebue Fabio - P-Soft wrote:<br>
><br>
> > This is my UDF source<br>
> ><br>
> > library pudf;<br>
> > {$mode objfpc}{$H+}<br>
> > uses<br>
> > Classes;<br>
> ><br>
> > function pround(var valore: real; ndec: integer):real;export;<br>
> > var<br>
> > i: integer;<br>
> > risultato: real;<br>
> > ndivisore: integer;<br>
> > begin<br>
> > risultato:= valore;<br>
> > ndivisore:= 1;<br>
> > for i:= 1 to ndec do<br>
> > begin<br>
> > risultato:= risultato*10;<br>
> > ndivisore:= ndivisore*10;<br>
> > end;<br>
> > result:= round(risultato)/ndivisore;<br>
> > end;<br>
> ><br>
> > exports<br>
> > pround name 'pround';<br>
> ><br>
> > begin<br>
> > end.<br>
> ><br>
> > but after insert into my fdb with instruction<br>
> ><br>
> > DECLARE EXTERNAL FUNCTION pround<br>
> > DOUBLE PRECISION, INTEGER<br>
> > RETURNS DOUBLE PRECISION BY VALUE<br>
> > ENTRY_POINT 'pround' MODULE_NAME 'pudf';<br>
> ><br>
> > if I use it with an instruction like this<br>
> ><br>
> > select round(123.1233, 2) as nrounded from rdb$database<br>
> ><br>
> > I have back this error<br>
> ><br>
> > Invalid token.<br>
> > invalid request BLR at offset 59.<br>
> > function PROUND is not defined.<br>
> > module name or entrypoint could not be found.<br>
> ><br>
> > do you have some idea regarding this error?<br>
><br>
> Where did you put the library, what is the library name ?<br>
><br>
> Michael.<br>
> _______________________________________________<br>
> fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a><br>
> <a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br>
><br>
><br>
> _______________________________________________<br>
> fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a><br>
> <a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br>
><br>
_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br>
<br>
<br>
_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div>-- <br><font color="#888888">Zaher Dirkey
</font></blockquote></div><br><br clear="all"><br>-- <br>Zaher Dirkey