I am passing in a IP address, a port #, a name and a debug option as four
strings.



This is the lines from the Java program to return the parm



public static String[] main(String[] args) throws Exception

{

String [] arrResult = new String[10];



(Other stuff in the middle here)



arrResult[0] = [Value read from scale];



return arrResult;

}





The RPG looks like this..(I don't even know if I'm in the ballpark or not)



H DFTACTGRP(*NO)

D JavaPGM pr STATIC

D EXTPROC(*JAVA:

D 'ScaleTools':

D 'main')

D O CLASS(*JAVA:'java.lang.String')

D DIM(5)



DString$new PR O EXTPROC(

D *JAVA:

D 'java.lang.String':

D *CONSTRUCTOR)

D CLASS(

D *JAVA:

D 'java.lang.String')

D bytes 60A CONST VARYING

D args S O CLASS(

D *JAVA:

D 'java.lang.String')

D DIM(5)





*setting up parameters to use in java call



C Eval args(1) = String$New('XXX.XX.XXX.XX')

C Eval args(2) = String$New('6001')

*call Java program

C Callp JavaPgm(args)



C Eval *InLR = *On





_____

date: Thu, 27 Sep 2012 11:14:00 -0500

from: Dan Kimmel < <mailto:dkimmel@xxxxxxxxxxxxxxx> dkimmel@xxxxxxxxxxxxxxx>

subject: RE: Newbie to RPG calling Java....what's a good reference to

start learning!



The archives of this list and the archives of the RPG list also on
midrange.com are a good place to start.



What types are you passing as parameters and what type are you expecting to
be returned? What versions of RPG, iOS and Java?



You might show us the interface of the java method you are trying to
prototype and what you have tried as a prototype and the errors you receive.







From: Steve Fekete [mailto:fekete1@xxxxxxx]
Sent: Thursday, September 27, 2012 11:23 AM
To: 'java400-l@xxxxxxxxxxxx'
Subject: Newbie to RPG calling Java....what's a good reference to start
learning!



I am a newbie to the Java world from RPG. I have an issue where I need to
call a java program passing in parms and then getting a return value back
from the java program.



What is a good reference to learn how to do this? Trying to prototype in
RPG to receive the return value back but keep getting errors so I'm in need
of more information.



Thanks ahead of time to anyone that can help!



Steve


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.