Thanks a lot - Re: Why I always get "null" returned when calling functions?

Francisco <jshzhang2000-/[email protected]> Tue, 27 Feb 2007 13:09:28 +0000 (GMT)
Newsgroups gmane.text.xml.o-xml
Message-ID <[email protected]>
--===============0918482990==
Content-Type: multipart/alternative; boundary="0-800916381-1172581768=:83459"
Content-Transfer-Encoding: 7bit

--0-800916381-1172581768=:83459
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Dear Martin,
  =20
  Your immediate help is highly appreciated here, many thanks for the wor=
king example and all links. I believe there should be running smoothly th=
is time. I will keep you informed when the overall system runs well.
  =20
  Have a great day!
  =20
  Kind regards,
  Francisco

Martin Klang <[email protected]> wrote:
  Francisco,

You need to match the function name and signature, in the same way as=20
when you call Class.getMethod(String, Class[]) in Java.

For example, if your function definition looks like this:








ie you've defined the function 'plus(Number, Number)', then you can=20
look up the function like this:

Function func =3D program.getResolver().getFunction(new Name("plus"),=20
new Type[]{NumberNode.TYPE, NumberNode.TYPE});

I have put together a couple of working examples that you can=20
download from here:
http://mars.pingdynasty.com/CallObjectboxExamples.zip

You need to have the latest objectbox.jar on your classpath to=20
compile and run the Java program.

best of luck, I look forward to hearing of your success!

/m


On 26 Feb 2007, at 16:16, Francisco wrote:

> Dear Martin,
>
> Sorry to bother you again. I have the difficulty in following your=20
> example to call the functions. The problem is mainly on this line=20
> -----
>
> Function func =3D program.getResolver().getFunction=20
> (functionName,signature);
>
> I always get "null" as return, I don't know how to solve it. I=20
> checked the API but couldn't find more details on how to pass the=20
> arguments or signatures for designated functions? I tried to put=20
> signatures inside. But still not succeed. Could you please kindly=20
> give a further explaination on this? Thank you very much for your=20
> help.
>
> Looking forward to your email.
>
> Kind regards,
> Francisco
>


 	=09
---------------------------------
 New Yahoo! Mail is the ultimate force in competitive emailing. Find out =
more at the Yahoo! Mail Championships. Plus: play games and win prizes.
--0-800916381-1172581768=:83459
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<div>Dear Martin,</div>  <div>&nbsp;</div>  <div>Your immediate help is h=
ighly appreciated here, many thanks for the working&nbsp;example and all =
links. I believe there should be running smoothly this time. I will keep =
you informed when the overall system runs&nbsp;well.</div>  <div>&nbsp;</=
div>  <div>Have a great day!</div>  <div>&nbsp;</div>  <div>Kind regards,=
</div>  <div>Francisco<BR><BR><B><I>Martin Klang &lt;[email protected]&gt;=
</I></B> wrote:</div>  <BLOCKQUOTE class=3Dreplbq style=3D"PADDING-LEFT: =
5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Francisco,<BR><BR>=
You need to match the function name and signature, in the same way as <BR=
>when you call Class.getMethod(String, Class[]) in Java.<BR><BR>For examp=
le, if your function definition looks like this:<BR><?xml:namespace prefi=
x =3D o /><o:function name=3D"plus"><BR><o:param type=3D"Node" name=3D"lh=
s"></o:param><BR><o:param type=3D"Node" name=3D"rhs"></o:param><BR><o:do>=
<BR><o:return select=3D"$lhs +
 $rhs"></o:return><BR></o:do><BR></o:function><BR><BR>ie you've defined t=
he function 'plus(Number, Number)', then you can <BR>look up the function=
 like this:<BR><BR>Function func =3D program.getResolver().getFunction(ne=
w Name("plus"), <BR>new Type[]{NumberNode.TYPE, NumberNode.TYPE});<BR><BR=
>I have put together a couple of working examples that you can <BR>downlo=
ad from here:<BR>http://mars.pingdynasty.com/CallObjectboxExamples.zip<BR=
><BR>You need to have the latest objectbox.jar on your classpath to <BR>c=
ompile and run the Java program.<BR><BR>best of luck, I look forward to h=
earing of your success!<BR><BR>/m<BR><BR><BR>On 26 Feb 2007, at 16:16, Fr=
ancisco wrote:<BR><BR>&gt; Dear Martin,<BR>&gt;<BR>&gt; Sorry to bother y=
ou again. I have the difficulty in following your <BR>&gt; example to cal=
l the functions. The problem is mainly on this line <BR>&gt; -----<BR>&gt=
;<BR>&gt; Function func =3D program.getResolver().getFunction <BR>&gt; (f=
unctionName,signature);<BR>&gt;<BR>&gt; I
 always get "null" as return, I don't know how to solve it. I <BR>&gt; ch=
ecked the API but couldn't find more details on how to pass the <BR>&gt; =
arguments or signatures for designated functions? I tried to put <BR>&gt;=
 signatures inside. But still not succeed. Could you please kindly <BR>&g=
t; give a further explaination on this? Thank you very much for your <BR>=
&gt; help.<BR>&gt;<BR>&gt; Looking forward to your email.<BR>&gt;<BR>&gt;=
 Kind regards,<BR>&gt; Francisco<BR>&gt;<BR></BLOCKQUOTE><BR><p>&#32;
		<hr size=3D1>=20
New Yahoo! Mail is the ultimate force in competitive emailing. Find out m=
ore at the <a href=3D"http://uk.rd.yahoo.com/mail/uk/taglines/yahoo_co_uk=
/championships/games/*http://uk.rd.yahoo.com/evt=3D44106/*http://mail.yah=
oo.net/uk/">Yahoo! Mail Championships</a>. Plus: play games and win prize=
s.
--0-800916381-1172581768=:83459--

--===============0918482990==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
o-xml mailing list
o-xml-zRfLyl9bSvv/[email protected]
http://lists.pingdynasty.com/mailman/listinfo/o-xml

--===============0918482990==--