Java syntax conversion to NetRexx (again :) )

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Java syntax conversion to NetRexx (again :) )

gpatrick
This is a snippet of code that I want to convert, and lines 1 & 3 are no problem and are done, but line 2 is where I'm stuck:
ObjectInputStream ois = new ObjectInputStream(
dataSocket.getInputStream( ));
EmployeeData eData = (EmployeeData) ois.readObject( );
System.out.println("Employee id : "+eData.getID( )
);

I tried:
eData = ois.readObject(EmployeeData)
and get:
 12 +++   eData = ois.readObject(EmployeeData)
    +++                          ^^^^^^^^^^^^
    +++ Error: Result of this expression cannot be just a type; it must have a value
Compilation of 'connectionServerObject.nrx' failed [one error]

I tried:
eData = (EmployeeData) ois.readObject()  
and get:
 12 +++   eData = (EmployeeData) ois.readObject()
    +++            ^^^^^^^^^^^^
    +++ Error: Result of this expression cannot be just a type; it must have a value
Compilation of 'connectionServerObject.nrx' failed [one error]
Reply | Threaded
Open this post in threaded view
|

Re: Java syntax conversion to NetRexx (again :) )

Marc Remes-2
java2nrx produces

         ois = ObjectInputStream
         ois = ObjectInputStream(dataSocket.getInputStream())
         eData = EmployeeData
         eData = (EmployeeData) ois.readObject()
         System.out.println("Employee id : " || eData.getID())


On 10/23/2013 05:57 PM, gpatrick wrote:

> This is a snippet of code that I want to convert, and lines 1 & 3 are no
> problem and are done, but line 2 is where I'm stuck:
> ObjectInputStream ois = new ObjectInputStream(
> dataSocket.getInputStream( ));
> EmployeeData eData = (EmployeeData) ois.readObject( );
> System.out.println("Employee id : "+eData.getID( )
> );
>
> I tried:
> eData = ois.readObject(EmployeeData)
> and get:
>   12 +++   eData = ois.readObject(EmployeeData)
>      +++                          ^^^^^^^^^^^^
>      +++ Error: Result of this expression cannot be just a type; it must have
> a value
> Compilation of 'connectionServerObject.nrx' failed [one error]
>
> I tried:
> eData = (EmployeeData) ois.readObject()
> and get:
>   12 +++   eData = (EmployeeData) ois.readObject()
>      +++            ^^^^^^^^^^^^
>      +++ Error: Result of this expression cannot be just a type; it must have
> a value
> Compilation of 'connectionServerObject.nrx' failed [one error]
>
>
>
> --
> View this message in context: http://ibm-netrexx.215625.n3.nabble.com/Java-syntax-conversion-to-NetRexx-again-tp4026820.html
> Sent from the ibm-netrexx mailing list archive at Nabble.com.
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>
>


--

Marc

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Java syntax conversion to NetRexx (again :) )

Gurmeet
In reply to this post by gpatrick
ois= ObjectInputStream(dataSocket.getInputStream( ))
eData= (EmployeeData) ois.readObject( )
say "Employee id: "eData.getID()