Re: passing parameter from IDL to Java [message #65491] |
Fri, 06 March 2009 08:37 |
None[1]
Messages: 13 Registered: August 2007
|
Junior Member |
|
|
On Mar 5, 4:52 pm, mgalloy <mgal...@gmail.com> wrote:
> Raj wrote:
>> Hi,
>> I am new to IDL-Java Bridge. I was wondering whether there is a way to
>> set the variables in Java from IDL. For example., setNum(number) from
>> an IDL program to a Java program which implements the function setNum
>> ().
>
>> Something like below....
>
>> NumGetset.java
>
>> public class NumGetset {
>> public int num1,num2;
>> public void setNum(int num1, int num2)
>> {
>> this.num1 = num1;
>> this.num2 = num2;
>> }
>> public int getNum1()
>> {
>> return this.num1;
>> }
>> public int getNum2()
>> {
>> return this.num2;
>> }
>
>> }
>
>> pro NumGetsetDemo
>
>> jo = OBJ_NEW('IDLJavaObject$NUMGETSET', 'NumGetset')
>
>> ;How to set the variables here? Is it possible to do that?
>> ;setNum(100,200)
>
>> print, 'Num1 = ', jo -> getNum1()
>> print, 'Num2 = ', jo -> getNum2()
>> OBJ_DESTROY, jo
>
>> end
>
> You should be able to do:
>
> jo->setNum, 100, 200
>
> Mike
> --www.michaelgalloy.com
> Associate Research Scientist
> Tech-X Corporation
Thanks a lot!!
Regards,
Rajesh
|
|
|
Re: passing parameter from IDL to Java [message #65499 is a reply to message #65491] |
Thu, 05 March 2009 13:52  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
Raj wrote:
> Hi,
> I am new to IDL-Java Bridge. I was wondering whether there is a way to
> set the variables in Java from IDL. For example., setNum(number) from
> an IDL program to a Java program which implements the function setNum
> ().
>
> Something like below....
>
> NumGetset.java
>
> public class NumGetset {
> public int num1,num2;
> public void setNum(int num1, int num2)
> {
> this.num1 = num1;
> this.num2 = num2;
> }
> public int getNum1()
> {
> return this.num1;
> }
> public int getNum2()
> {
> return this.num2;
> }
>
> }
>
> pro NumGetsetDemo
>
> jo = OBJ_NEW('IDLJavaObject$NUMGETSET', 'NumGetset')
>
> ;How to set the variables here? Is it possible to do that?
> ;setNum(100,200)
>
> print, 'Num1 = ', jo -> getNum1()
> print, 'Num2 = ', jo -> getNum2()
> OBJ_DESTROY, jo
>
> end
You should be able to do:
jo->setNum, 100, 200
Mike
--
www.michaelgalloy.com
Associate Research Scientist
Tech-X Corporation
|
|
|