May be you UDF depend on external library try to View Dependency.<br><br><div class="gmail_quote">On Sat, Mar 15, 2008 at 4:05 PM, Stephano <<a href="mailto:patspiper@yahoo.com">patspiper@yahoo.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;">
<div><div></div><div class="Wj3C7c">>> nothing todo...<br>
>> ok restart:<br>
>> library pudf;<br>
>><br>
>> {$mode objfpc}{$H+}<br>
>><br>
>> uses<br>
>> Classes,<br>
>> p_func in 'p_func.pas';<br>
>><br>
>> exports<br>
>> pround name 'p_round';<br>
>><br>
>> {$R pudf.res}<br>
>><br>
>> begin<br>
>><br>
>> // DECLARE EXTERNAL FUNCTION pround<br>
>> // DOUBLE PRECISION, INTEGER<br>
>> // RETURNS DOUBLE PRECISION BY VALUE<br>
>> // ENTRY_POINT 'pudf_pround' MODULE_NAME 'pudf';<br>
>><br>
>> end.<br>
>><br>
>> and<br>
>><br>
>> unit p_func;<br>
>><br>
>> {$mode objfpc}{$H+}<br>
>><br>
>> interface<br>
>> function p_round(var valore: double; ndec: integer): double; cdecl;<br>
>><br>
>> implementation<br>
>><br>
>> uses<br>
>> Classes, SysUtils;<br>
>><br>
>> function p_round(var valore: double; ndec: integer): double; cdecl;<br>
>> var<br>
>> i: integer;<br>
>> risultato: double;<br>
>> ndivisore: integer;<br>
>> begin<br>
>><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>
>><br>
>> result:= round(risultato)/ndivisore;<br>
>> end;<br>
>> end.<br>
>><br>
>> someone can compile and install?<br>
>><br>
>> I can... but when I try to execute<br>
>><br>
>> select round(123.1233, 2) as nrounded from rdb$database<br>
>><br>
>> always some error!!!<br>
<br>
</div></div>- Entry point should be p_round only in this case<br>
<br>
- Adding also 'export' in the function declaration should help:<br>
<br>
function p_round(var valore: double; ndec: integer): double; cdecl; export;<br>
<br>
- The following needs to be corrected as well:<br>
<div class="Ih2E3d">exports p_round name 'p_round';<br>
</div>_________^<br>
<div><div></div><div class="Wj3C7c">_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org">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>-- <br>Zaher Dirkey